1
0
Fork 0

Use Brakeman (closes #11)

This commit is contained in:
Alex Kotov 2018-12-05 04:42:05 +05:00
parent 6ad21e32b0
commit 95f10b8022
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
4 changed files with 21 additions and 2 deletions

View File

@ -112,6 +112,10 @@ group :development, :test do
# bundler-audit provides patch-level verification for Bundled apps.
gem 'bundler-audit', '~> 0.6'
# Brakeman detects security vulnerabilities
# in Ruby on Rails applications via static analysis.
gem 'brakeman', '~> 4.3'
end
group :development do

View File

@ -59,6 +59,7 @@ GEM
autoprefixer-rails (>= 6.0.3)
popper_js (>= 1.12.9, < 2)
sass (>= 3.5.2)
brakeman (4.3.1)
builder (3.2.3)
bundler-audit (0.6.0)
bundler (~> 1.2)
@ -396,6 +397,7 @@ DEPENDENCIES
bcrypt (~> 3.1)
bootsnap (>= 1.1.0)
bootstrap (~> 4.1.3)
brakeman (~> 4.3)
bundler-audit (~> 0.6)
byebug
capistrano (~> 3.11)

View File

@ -8,7 +8,7 @@ desc 'Run all checks (test, lint...)'
task default: :lint
desc 'Run all code analysis tools (RuboCop...)'
task lint: %i[rubocop bundler:audit]
task lint: %i[rubocop bundler:audit brakeman]
desc 'Fix code style (rubocop --auto-correct)'
task fix: 'rubocop:auto_correct'
@ -48,3 +48,16 @@ namespace :bundler do
rescue LoadError
nil
end
desc 'Detects security vulnerabilities via static analysis'
task :brakeman do
sh(
'bundle',
'exec',
'brakeman',
Rails.root.to_s,
'--confidence-level',
'1',
'--run-all-checks',
)
end

View File

@ -13,7 +13,7 @@
<%= f.input :password,
hint: translate('.leave_blank_if_you_don_t_want_to_change_it'),
required: false
required: false,
input_html: { autocomplete: 'new-password' } %>
<%= f.input :password_confirmation,