SSDL Touchpoints: Code Review (CR)

The overall goal of the Code Review practice is quality control. Those performing code review must ensure the detection and correction of security bugs. The SSG must enforce adherence to standards and the reuse of approved security features.

SSDL TOUCHPOINTS: CODE REVIEW
Use of code review tools, development of customized rules, profiles for tool use by different roles, manual analysis, ranking/measuring results.
  Objective Activity Level
CR1.1 know which bugs matter to you create top N bugs list (real data preferred) (T: training) 1
CR1.2 review high-risk applications opportunistically have SSG perform ad hoc review
CR1.3 spread software security around without any process establish coding labs or office hours focused on review
CR2.1 drive efficiency/consistency with automation use automated tools along with manual review 2
CR2.2 drive behavior objectively enforce coding standards
CR2.3 find bugs earlier make code review mandatory for all projects
CR2.4 know which bugs matter (for training) use centralized reporting (close knowledge loop, drive training) (T: strategy/metrics)
CR2.5 make most efficient use of tools assign tool mentors
CR3.1 drive efficiency/reduce false positives use automated tools with tailored rules 3
CR3.2 combine assessment techniques build a factory
CR3.3 handle new bug classes in an already scanned codebase build capability for eradicating specific bugs from entire codebase
one

CR Level 1: SSG does code review. The SSG must make itself available to others to raise awareness of and demand for code review. The SSG must perform code reviews on high-risk applications whenever it can get involved in the process and must use the knowledge gained to inform the organization of the types of bugs being discovered.

two

CR Level 2: Enforce standards through mandatory automated code review and centralized reporting. Management must make code review mandatory for all software projects. The SSG must guide developer behavior through coding standards enforcement with automated tools and tool mentors. The SSG must enforce use of centralized tools reporting to capture knowledge on recurring bugs and push that information into strategy and training.

CR2.1

Use automated tools along with manual review. Incorporate static analysis into the code review process in order to make code review more efficient and more consistent. The automation does not replace human judgment, but it does bring definition to the review process and security expertise to reviewers who are not security experts.

CR2.2

Enforce coding standards. A violation of the organization's coding standard is sufficient grounds for rejecting a piece of code. Code review is objective; it does not devolve into a debate about whether or not bad code is exploitable. The enforced portion of the standard could be as simple as a list of banned functions.

CR2.3

Make code review mandatory for all projects. Code review is a mandatory release gate for all projects. Lack of code review or unacceptable results will stop the release train. While all projects must undergo code review, the review process might be different for different kinds of projects. The review for low-risk projects might rely more heavily on automation, and the review for high-risk projects might have no upper bound on the amount of time spent by reviewers.

CR2.5

Assign tool mentors. Mentors are available to show developers how to get the most out of code review tools. If the SSG is most skilled with the tools, it could use office hours to help developers establish the right configuration or get started interpreting results. Alternatively, someone from the SSG might work with a development team for the duration of the first review they perform.

three

CR Level 3: Build an automated code review factory with tailored rules. The SSG must combine automated assessment techniques with tailored rules to find problems efficiently. The SSG must build a capability to find and eradicate specific bugs from the entire codebase.