安全软件
点击放大

![Brakeman Logo]()
![Build Status]()
![Code Co]()
Brakeman is a static analysis tool which checks Ruby on Rails applications for security .
Using RubyGems:
gem install brakeman
Using Bundler:
Using Docker:
docker pull presidentbeef/brakeman
Using Docker to build from source:
git clone
cd brakeman
docker build . -t brakeman
#### Running locally
From a Rails application's root directory:
brakeman
Outside of Rails root:
brakeman /path/to/rails/application
#### Running with Docker
From a Rails application's root directory:
docker run -v "$(pwd)":/code presidentbeef/brakeman
With a little nicer color:
docker run -v "$(pwd)":/code presidentbeef/brakeman --color
For an HTML report:
docker run -v "$(pwd)":/code presidentbeef/brakeman -o brakeman_results.html
Outside of Rails root (note that the output file is relative to path/to/rails/application):
docker run -v 'path/to/rails/application':/code presidentbeef/brakeman -o brakeman_results.html
Brakeman should work with any of Rails from 2.3.x to 8.x.
Brakeman can analyze code written with Ruby 2.0 syntax and newer, but requires at least Ruby 3.2.0 to run.
For a full list of options, use brakeman --help or see the OPTIONS.md file.
To specify an output file for the results:
brakeman -o output_file
The output format is determined by the file extension or by using the -f option. Current options are: text, html, tabs, json, junit, markdown, csv, codeclimate, github, sarif, and sonar.
Multiple output files can be specified:
brakeman -o output.html -o output.json
To output to both a file and to the console, with color:
brakeman --color -o /de -o output.json
To suppress informational warnings and just output the report:
brakeman -q
Note all Brakeman output except reports are sent to stderr, making it simple to redirect stdout to a file and just get the report.
To see all kinds of debugging information:
brakeman -d
Specific checks can be skipped, if desired. The name needs to be the correct case. For example, to skip looking for default routes (DefaultRoutes):
brakeman -x DefaultRoutes
Multiple checks should be separated by a comma:
brakeman -x DefaultRoutes,Redirect
To do the opposite and only run a certain set of tests:
brakeman -t SQL,
If Brakeman is running a bit slow, try
brakeman --faster
This will disable some features, but will probably be much faster (currently it is the same as --skip-libs --no-branching). *WARNING*: This may cause Brakeman to miss some .
By default, Brakeman will return a non-zero exit code if any security warnings are found or scanning errors are encountered. To disable this:
brakeman --no-exit-on-warn --no-exit-on-error
To skip certain files or directories that Brakeman may ha parsing, use:
brakeman --skip-files file1,/path1/,path2/
To compare results of a scan with a previous scan, use the JSON output option and then:
brakeman --compare old_report.json
This will output JSON with two lists: one of fixed warnings and one of new warnings.
Brakeman will ignore warnings if configured to do so. By default, it looks for a configuration file in config/brakeman.ignore.
To create and manage this file, use:
brakeman -I
If you want to temporarily see the warnings you ignored without affecting the exit code, use:
brakeman --show-ignored
See warning\_types for more information on the warnings reported by this tool.
The HTML output format provides an excerpt from the original application source where a warning was triggered. Due to the processing done while looking for , the source may not resemble the reported warning and reported line numbers may be slightly off. However, the context still provides a quick look into the code which raised the warning.
Brakeman assigns a confidence level to each warning. This provides a rough estimate of how certain the tool is that a gi is actually a problem. Naturally, these ratings should not be taken as absolute truth.
There are three levels of confidence:
+ High - Either this is a simple warning (boolean value) or user input is very likely being used in unsafe ways.
+ Medium - This generally indicates an unsafe use of a , but the may or may not be user input.
+ Weak - Typically means user input was indirectly used in a potentially unsafe manner.
To only get warnings above a gi level:
brakeman -w3
The -w switch takes a number from 1 to 3, with 1 being low (all warnings) and 3 being high (only highest confidence warnings).
Brakeman options can be stored and read from YAML files.
To simplify the process of writing a configuration file, the -C option will output the currently set options:
Options passed in on the commandline ha o files.
The default config locations are ./config/brakeman.yml, ~/.brakeman/config.yml, and /etc/brakeman/config.yml
The -c option can be used to specify a configuration file to use.
There is a plugin a for Jenkins/Hudson.
For even more continuous testing, try the Guard plugin.
There are a couple GitHub Actions a.
git clone git://github.com/presidentbeef/brakeman.git
cd brakeman
gem build brakeman.gemspec
gem install brakeman*.gem
* Code Climate
* GitHub
* Groupon
* New Relic
* Twitter
..and more!
Website:
Twitter:
Chat:
Brakeman is free for non-commercial use.
See COPYING for details.
开发语言:Ruby
Star 数:7275
该项目属于安全软件方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕A static analysis security vulnerability scanner for Ruby on Rails applications展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | brakeman - A static analysis security vulnerability scanner f |
| 所属分类 | 安全软件 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:31:58 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 453 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |