Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 1 of 6 · Concept · 15 min · revision 2

Where Security Review Fits in Delivery

See where security checks belong in a delivery pipeline and why, map them to the NIST Secure Software Development Framework, and build a short, focused pull-request checklist from OWASP ASVS 5.0 based on what a change actually touches.

Contentsand lesson path

On this page

  1. Why it matters
  2. Security checks along the delivery path
  3. A focused checklist from ASVS
  4. What reviewers look for
  5. Check your understanding
  6. Apply it
  7. Review prompt

Lessons of Secure Coding & Code Review

  1. Where Security Review Fits in Delivery Concept · 15 min
  2. Tracing Untrusted Input from Source to Sink Worked example · 25 min
  3. Static, Dependency and Secret Scanning in CI Lab · 30 min
  4. Triaging and Tuning Scanner Results Worked example · 20 min
  5. Fixes That Stay Fixed Lab · 25 min
  6. Secure Code Review Check Knowledge check · 6 questions

What you will learn

  • Perform a focused manual security review of a pull request with a checklist derived from OWASP ASVS, tracing untrusted input from source to sink.

Prerequisites: Web Application Security

01. Why it matters

A security flaw costs least to fix in the place where it was made. A missing ownership check spotted in a pull request takes ten minutes to fix; the same flaw found after release can mean an incident, notifying customers and a rushed patch. Security review is the set of checks a team uses to catch flaws close to where they are made: in the design, in the pull request, in the build and in testing.

No single check catches everything. Automated scanners are fast and consistent but miss business logic, such as "a member may only see their own loans". Human reviewers understand intent but get tired and inconsistent. A good delivery process layers both, and puts each check where it gives the fastest useful feedback. This lesson gives you the map; the rest of the skill fills it in with tracing (lesson 2), scanners (lessons 3 and 4) and fixes that last (lesson 5).

02. Security checks along the delivery path

Follow one change, "members can upload a cover photo", from idea to production.

  1. Design. Before code exists, a short threat model asks what could go wrong: oversized files, someone replacing another member's cover, photos that reveal a location. This is the cheapest point to change the design.
  2. Pull request. A reviewer reads the diff with a checklist for the areas it touches and traces untrusted input to where it is used. Fast automated checks run on the same pull request and report within minutes.
  3. Build. CI runs static analysis on your code, dependency scanning on the libraries you ship and secret scanning on the files. Findings that are almost always real block the merge; the rest are reported for triage.
  4. Test. Security tests prove that controls work, such as "user A cannot read user B's order". Bigger releases may get a penetration test, where specialists try to break the running system.
  5. Release and operate. Configuration is reviewed, logs and alerts watch for abuse, and when a vulnerability is reported the team fixes it and asks why it happened.

The idea of moving checks earlier is often called shifting left. It does not mean everything must happen at the pull request. A check that takes an hour or produces many false alarms belongs in a nightly job, not in a blocking gate, because a slow or noisy gate trains developers to work around it.

The NIST Secure Software Development Framework (SSDF, SP 800-218) gives organisations a shared vocabulary for these practices. It groups them into four families:

  • Prepare the Organization (PO): roles, training, tooling and the security requirements the team works to.
  • Protect the Software (PS): protect code, builds and releases from tampering and unauthorised access.
  • Produce Well-Secured Software (PW): design with security in mind, review and analyse code, test it, and configure it securely by default.
  • Respond to Vulnerabilities (RV): find and fix vulnerabilities after release, and analyse their root causes so the same kind of flaw stops coming back.

Pull-request review and CI scanning sit mainly in PW. Lesson 5's "fixes that stay fixed" is RV feeding back into PW.

03. A focused checklist from ASVS

The OWASP Application Security Verification Standard (ASVS) is a list of security requirements that can be verified, grouped into chapters such as V1 Encoding and Sanitization, V5 File Handling, V8 Authorization and V16 Security Logging and Error Handling. Version 5.0 has 17 chapters and three levels: Level 1 is the baseline for every application, and Levels 2 and 3 add requirements for applications that hold more sensitive data or face stronger attackers.

ASVS is not a vulnerability list and not a scanner configuration. It describes what "secure" means for each area, so you can turn it into questions. Checking several hundred requirements on every pull request is not practical, so reviewers pick the few that apply to what the change touches. The script below shows the idea: it reads the list of changed files and prints the matching ASVS requirements as a checklist. Save it as checklist.py, save the file list (the output of git diff --name-only) as changed.txt, and run it with Python 3.10 or later.

Python · checklist.py
"""Build a short review checklist from the files a pull request changes.
Requirement numbers are from OWASP ASVS 5.0."""
import sys

AREAS = [
    ("authorisation", ("api/", "views/"), [
        ("8.2.2", "each object read or changed is checked against the caller"),
        ("8.3.1", "the check runs on the server, not only in the browser")]),
    ("file upload", ("upload", "storage/"), [
        ("5.2.1", "file size is limited to what the app can process"),
        ("5.2.2", "extension and real content type are both checked"),
        ("5.3.1", "uploaded files can never run as server code")]),
    ("database", ("db/", "repo", "sql"), [
        ("1.2.4", "queries use parameters, never pasted request data")]),
    ("templates", ("templates/", ".html"), [
        ("1.2.1", "output is encoded for its context; no raw-HTML helpers")]),
    ("outgoing requests", ("fetch", "webhook", "preview"), [
        ("1.3.6", "URLs from users are checked against an allow-list")]),
]
ALWAYS = [("16.5.1", "errors show a generic message, no stack traces or secrets")]

changed = [line.strip() for line in open(sys.argv[1]) if line.strip()]
print(f"{len(changed)} files changed")
for area, hints, items in AREAS:
    hits = [path for path in changed if any(h in path for h in hints)]
    if hits:
        print(f"[{area}] because of {', '.join(hits)}")
        for number, text in items:
            print(f"  [ ] ASVS {number}: {text}")
print("[every change]")
for number, text in ALWAYS:
    print(f"  [ ] ASVS {number}: {text}")
Text · changed.txt
app/api/covers.py
app/storage/upload.py
app/templates/book.html
tests/test_covers.py
README.md
Terminal
python3 checklist.py changed.txt
Expected output
5 files changed
[authorisation] because of app/api/covers.py
  [ ] ASVS 8.2.2: each object read or changed is checked against the caller
  [ ] ASVS 8.3.1: the check runs on the server, not only in the browser
[file upload] because of app/storage/upload.py
  [ ] ASVS 5.2.1: file size is limited to what the app can process
  [ ] ASVS 5.2.2: extension and real content type are both checked
  [ ] ASVS 5.3.1: uploaded files can never run as server code
[templates] because of app/templates/book.html
  [ ] ASVS 1.2.1: output is encoded for its context; no raw-HTML helpers
[every change]
  [ ] ASVS 16.5.1: errors show a generic message, no stack traces or secrets

Six items is a checklist a reviewer can actually work through. The change to app/api/covers.py brings in the authorisation questions, the storage change brings in file handling, and the template change brings in output encoding. The test and README changes add nothing. A real team would keep the mapping in its repository and refine it after every incident, adding requirements that would have caught the last miss.

04. What reviewers look for

A checklist points at the right areas; the reviewer still has to think. Four habits find most real problems.

  • Validate input, encode output. Input validation checks that data has the expected form (a number, a known sort option). Output encoding converts data for the place it is used, such as escaping < in HTML. They solve different problems, and validation alone does not make a value safe for every context.
  • Fail safely, default to closed. When something goes wrong, the code should deny access and show a generic error, not a stack trace. New settings should start in the safe state: private, not public.
  • Check authorisation on every object. Being signed in is not permission to see everything. Look for any place where an id from the request loads a record.
  • Know your language's risks. In C and C++, memory-safety bugs such as buffer overflows (writing past the end of a buffer) and use-after-free (using memory after it was released) are a major source of serious vulnerabilities. Memory-safe languages such as Rust, Go, Java, C# and Python prevent most of these bug classes by design, which is one reason new components are increasingly written in them.

Teams rarely have enough security specialists to review every pull request. Many train security champions: developers in each team who learn these habits, review the riskier changes and know when to call the application security team. Champions make review part of normal work instead of a queue in front of one expert.

05. Check your understanding

Practice check · 3 questions

Placing security checks

Answer from this lesson and the checklist script.

Q1. A pull request changes only `app/db/loans_repo.py` and `docs/CHANGELOG.md`. Which sections does checklist.py print?
Q2. The same IDOR has come back three times, so the team analyses why and changes its review checklist. Which SSDF family does that work belong to?
Q3. A check takes 40 minutes and about half of its findings are false alarms. Where does it fit best?
Practice only: not graded, not saved, not evidence.

06. Apply it

For the skill project, take the pull request in the intentionally vulnerable sample repository and write its checklist: list the changed files, pick the ASVS 5.0 chapters they touch, and write five to eight concrete questions. Keep the checklist; you will use it in lesson 2 while tracing inputs through the same pull request.

07. Review prompt

From memory, list the five stages of delivery and one security check for each. Name the four SSDF families, and explain in two sentences why a pull-request checklist uses a few ASVS requirements instead of all of them.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

6 questions · about 5 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check