Security Scanning in CI/CD: SAST, DAST, and SCA in GitHub Actions
How I wire CodeQL, Trivy, Dependency Review, and OWASP ZAP into pipelines so findings surface while a change is still cheap to fix.
Three scanners, three blind spots
SAST reads your code and finds dangerous patterns. SCA reads your dependencies and finds known vulnerabilities in other people's code. DAST probes the running application and finds what only shows up at runtime. Any one of them alone leaves a hole shaped like the other two.
The GitHub Actions layout
- CodeQL runs on push and pull request for SAST, with the query suites matched to the languages in the repository
- Dependency Review runs on pull requests, so a vulnerable dependency is flagged before it merges, not after
- Trivy scans container images and infrastructure as code for known CVEs and misconfigurations
- OWASP ZAP runs a baseline scan against the deployed staging environment for DAST coverage
Gating without crying wolf
A pipeline that fails on everything gets ignored. The gate fails the build on critical findings with a reachable exploit path, warns on the rest, and records every suppression with a reason and an expiry date. Developers keep moving, and real risk still stops the line.
The same pattern elsewhere
The layout is not GitHub-specific. The same four stages map directly onto Jenkins and GitLab CI; only the syntax changes. The design decisions are the part worth getting right: what runs where, what gates the build, and what merely reports.