Brakeman is a Rails security scanner – unlike many web security scanners, Brakeman looks at the source code of your application. This means you do not need to set up your whole application stack to use it. Once Brakeman scans the application code, it produces a report of all security issues it has found.
It works with Rails 2.x, 3.x, and 4.x.
The only other Ruby-centric tool we’ve covered is:
– Codesake::Dawn – Static Code Analysis Security Scanner For Ruby
If you are interested in more tools of this type you can find our complete list here (which covers various languages) – Code Auditing Tools.
Advantages
No Configuration Necessary
Brakeman requires zero setup or configuration once it is installed. Just run it.
Run It Anytime
Because all Brakeman needs is source code, Brakeman can be run at any stage of development: you can generate a new application with rails new and immediately check it with Brakeman.
Better Coverage
Since Brakeman does not rely on spidering sites to determine all their pages, it can provide more complete coverage of an application. This includes pages which may not be ‘live’ yet. In theory, Brakeman can find security vulnerabilities before they become exploitable.
Best Practices
Brakeman is specifically built for Ruby on Rails applications, so it can easily check configuration settings for best practices.
Flexible Testing
Each check performed by Brakeman is independent, so testing can be limited to a subset of all the checks Brakeman comes with.
Speed
While Brakeman may not be exceptionally speedy, it is much faster than “black box” website scanners. Even large applications should not take more than a few minutes to scan.
Installation
Using RubyGems:
1 |
gem install brakeman |
Using Bundler, add to development group in Gemfile and set to not be required automatically:
1 2 3 |
group :development do gem 'brakeman', :require => false end |
From source:
1 2 |
gem build brakeman.gemspec gem install brakeman*.gem |
You can download Brakeman 2.6.3 here:
Or read more here.