Security Code Review in the SDLC

Security code reviews vary widely in their level of formality. Reviews can be as informal as inviting a friend to help look for a hard-to-find vulnerability, and they can be as formal as a software inspection process with trained teams, assigned roles and responsibilities, and a formal metric and quality tracking program.

In Peer Reviews in Software, Karl Wiegers lists seven review processes from least to most formal:


 * 1) Ad hoc review
 * 2) Passaround
 * 3) Pair programming
 * 4) Walkthrough
 * 5) Team review
 * 6) Inspection

Throughout the SDLC there are points at which an application security consultant should get involved. Performing security activities across the lifecycle has proven to be far more cost-effective than either a “big design up front” security effort or a single pre-production security review. The reason for intervening at regular intervals is that potential issues can be detected early on in the development life cycle where they are less costly to address.

Integration of security code review into the System Development Life Cycle (SDLC) can yield dramatic results to the overall quality of the code developed. Security code review is not a silver bullet, but is part of a healthy application development diet. Consider it as one of the layers in a defense-in-depth approach to application security. Security code review is also a cornerstone of the approach to developing secure software. The idea of integrating a phase into your SLDC may sound daunting, yet another layer of complexity or an additional cost, but in the long term and in today's cyber landscape it is cost effective, reputation building, and in the best interest of any business to do so.

Waterfall SDLC Example


 * 1) Requirements definition
 * 2) Application Security Requirements
 * 3) Architecture and Design
 * 4) Application Security Architecture and/or Threat Model
 * 5) Development
 * 6) Secure Coding Practices
 * 7) Security Testing
 * 8) Security Code Review
 * 9) Test
 * 10) Penetration Testing
 * 11) Deployment
 * 12) Secure Configuration Management
 * 13) Secure Deployment
 * 14) Maintenance



Agile Security Methodology Example
 * 1) Planning
 * 2) Identify Security Stakeholder Stories
 * 3) Identify Security Controls
 * 4) Identify Security Test Cases
 * 5) Sprints
 * 6) Secure Coding
 * 7) Security Test Cases
 * 8) Peer Review with Security
 * 9) Deployment
 * 10) Security Verification (with Penetration Testing and Security Code Review)