Security and Static Code Analyzers

Episode #62 by Teacher's Avatar David Kimura

Summary

Whether you're preparing for a third-party security scan or already doing peer code reviews, you should always run brakeman scanner on your application to identify potential security vulnerabilities.
rails security 8:12

Resources

Summary

# Terminal
gem install brakeman
brakeman -o brakeman.html

Open the brakeman.html within your browser for an interactive report

# Terminal
gem install guard guard-brakeman

# Guardfile
guard 'brakeman', run_on_start: true, quiet: true do
  watch(%r{^app/.+\.(erb|haml|rhtml|rb)$})
  watch(%r{^config/.+\.rb$})
  watch(%r{^lib/.+\.rb$})
  watch('Gemfile')
end