Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add audit options #2

Merged
merged 1 commit into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ output example:

![](doc/imgs/code_quality_security_audit_failed_example.png)

#### options for security_audit:

```
# e.g.: code_quality security_audit bundler_audit_options="--ignore CVE-2015-9284"
# options:
# bundler_audit_options: pass extract options, e.g.: bundler_audit_options="--ignore CVE-2015-9284 --verbose"
```

#### work with CI

Expand Down
4 changes: 3 additions & 1 deletion lib/tasks/code_quality.rake
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ namespace :code_quality do

desc "bundler audit"
task :bundler_audit => :prepare do |task|
options = options_from_env(:bundler_audit_options)

run_audit task, "bundler audit - checks for vulnerable versions of gems in Gemfile.lock" do
# Update the ruby-advisory-db and check Gemfile.lock
report = `bundle audit check --update`
report = `bundle audit check --update #{options[:bundler_audit_options]}`
@report_path = "#{report_dir}/bundler-audit-report.txt"
File.open(@report_path, 'w') {|f| f.write report }
puts report
Expand Down