Intermediate

SAST and DAST Pipeline Integration

Add static analysis (Semgrep) and dynamic analysis (OWASP ZAP) to a CI pipeline against a small intentionally-vulnerable web app, understand what each catches that the other can't, and gate the pipeline on both.

~3h
0 / 6 steps
🚀
Intro

Before We Start

Prerequisites: Docker installed, a small local web application to scan (OWASP Juice Shop, run via Docker, works well and is designed for exactly this purpose), and Semgrep installed (pip install semgrep or via the Semgrep CLI).

SAST (Static Application Security Testing) reads source code without running it, looking for known-dangerous patterns — string-concatenated SQL, disabled certificate validation, use of a deprecated crypto function. DAST (Dynamic Application Security Testing) runs the application and attacks it from the outside like a real adversary would, over HTTP, with no knowledge of the source. They catch different, largely non-overlapping classes of bugs: SAST catches a SQL-injection-shaped code pattern even in a code path nobody's manually tested yet; DAST catches an actual exploitable SQL injection that only manifests once the app, its framework, its middleware, and its configuration are all combined and running.

Running both isn't redundant — it's the accepted way to get meaningfully broad coverage without either tool doing the other's job badly. You'll run each against the same known-vulnerable application (OWASP Juice Shop, deliberately built full of real, catalogued vulnerabilities for training and tooling purposes) and compare what each one finds.

🔨

Run Semgrep (SAST) against source code

🔨

Stand up the target and run OWASP ZAP (DAST) against it

🔨

Wire both into a CI pipeline with different gating rules

🎯
Secret Mission

Secret Mission: Triage a real finding end to end

🧹
Wrap Up

Before You Go

Pro

Test what you just learned

Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.

Log in to unlock