The project is in a healthy, maintained state
Brakeman detects security vulnerabilities in Ruby on Rails applications via static analysis.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 7.0.0
~> 0.19
 Project Readme

Brakeman for Ruby LSP

This library enables running Brakeman via Ruby LSP.

The library is in early but working stages. It has only been tested with VS Code so far.

Installation

Add ruby-lsp-brakeman to your Gemfile:

gem 'ruby-lsp-brakeman', require: false

Bundle install and restart the Ruby LSP server/extension to enable.

In Action

Initialization output should look like this:

Starting Brakeman in Ruby LSP/VS Code

Display of inline warnings on hover:

Display of Brakeman warning

Display after clicking "View Problem":

Display of Brakeman warning

Warnings are listed as "problems" in VS Code's panel:

Listing of Brakeman warnings

When files are saved, Brakeman will rescan the files and update any impacted warnings. Note that scans are asynchronous and only one scan will run at a time. If multiple files are changed while a scan is running, they will be queued and then rescanned all together when the current scan finishes.

Queuing, scanning, reported changes

Limitations

  • Column numbers are not available right now, so the entire line is always reported
  • Brakeman's rescanning capabilities are currently being overhauled. They work but may be a little slow (but still faster than a full scan)
  • Large applications may require way too much memory for incremental scans to be useful
  • Warnings may not clear if Ruby LSP crashes
  • VS Code does not seem to support CodeDescription which can link to more information
  • No tests yet, so buyer beware

License

The gem is available as open source under the terms of the MIT License.