Mid-level Track Roadmap

Security audits: Brakeman

This course runs Brakeman, a static analyzer for Rails, against a real report from this repository. The report held six warnings: three format-validation warnings about regex anchors and three possible SQL injections in a search query. Each one is triaged by tracing where values come from and whether the safety is local to the code. The lessons separate confidence from severity and cover running Brakeman in CI with baselines and ignore files. They also list what scanners cannot find and close with a security workflow combining tools and human review.

What you'll learn

  • ✓How Brakeman tracks untrusted data from sources to dangerous sinks
  • ✓Why Ruby validation regexes need \A and \z anchors
  • ✓A four-question method for triaging SQL-injection warnings
  • ✓The difference between a warning's confidence and its severity
  • ✓Running Brakeman in CI with baselines and documented ignore files
  • ✓Which security problems need human review because no scanner finds them
Free preview · Lesson 1 5 min read

Running Brakeman on this repository

The previous course ended with an audit and a list of things a person has to look for. Brakeman is the part of that list a program can do: it reads your Rails source, follows data from user input to dangerous method calls, and reports what it finds.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...