What is SAST, DAST and SCA?
BeginnerConceptSecurity basics for DevOps
Answer
In one line: SAST scans your source code for security bugs without running it, DAST attacks the running application from the outside like a hacker would, and SCA checks your third-party libraries for known vulnerabilities and licence problems.
SAST — Static Application Security Testing
- Analyses source code (or bytecode) for insecure patterns: SQL injection, hard-coded credentials, unsafe deserialisation, XSS.
- Runs early — in the IDE and in every pull request.
- Tools: SonarQube, Semgrep, CodeQL, Checkmarx, Fortify.
- Pros: finds issues early, points to the exact line. Cons: can have false positives; doesn't see runtime configuration.
DAST — Dynamic Application Security Testing
- Tests the running app (usually in staging) by sending malicious-looking requests and checking the responses.
- Finds problems like missing security headers, injection flaws, authentication issues, misconfigured servers.
- Tools: OWASP ZAP, Burp Suite, Nuclei.
- Pros: tests the real deployed behaviour. Cons: runs later, slower, and doesn't show the exact code line.
SCA — Software Composition Analysis
- Scans dependencies (npm, Maven, pip packages) for known CVEs and risky licences.
- Most modern apps are mostly open-source code, so this is critical (remember Log4Shell).
- Tools: OWASP Dependency-Check, Snyk, Dependabot, Renovate, Trivy, Grype.
Where they go in the pipeline:
Commit → secret scan → SAST + SCA (PR) → build image → image scan → deploy to staging → DAST → production
Related scans: secret scanning (Gitleaks), container image scanning (Trivy), IaC scanning (Checkov), and IAST/RASP for runtime.
| SAST | DAST | SCA | |
|---|---|---|---|
| Looks at | Your code | Running app | Third-party libraries |
| When | PR / build | After deploy to test | PR / build |
| Finds | Code-level flaws | Runtime/config flaws | Known CVEs, licences |
Tip for interviews: name a tool for each and say where it runs and whether it blocks the pipeline.
More on Security basics for DevOps
What is the principle of least privilege?BeginnerWhat is a CVE, and how do you handle vulnerabilities found by scanners?BeginnerWhat is container image scanning, and where should it happen?BeginnerWhat is software supply chain security (SBOM, image signing, SLSA)?IntermediateWhat is secrets management, and why shouldn't secrets be in code?BeginnerWhat is encryption in transit and encryption at rest?Beginner