Domain 6 Β· Lesson 4 of 5
SAST, DAST, SCA & Fuzzing
Kiα»m thα» BαΊ£o mαΊt Ứng dα»₯ng
Application Security Testing Tools
| Type | What it Scans | When | Go Tools | Pros | Cons |
|---|---|---|---|---|---|
| SAST Static Analysis |
Source code (static) β no running app needed | Pre-build, IDE, CI | gosec, Semgrep |
Early detection; finds secrets in code; no running app needed | High false positive rate β needs human triage |
| DAST Dynamic Analysis |
Running application (black-box from outside) | Staging, pre-prod | OWASP ZAP, Burp Suite | Realistic; finds auth/config/runtime issues | Needs running app; may miss code-level issues |
| IAST Interactive Analysis |
Runtime with instrumentation agent inside app | Testing phase | Contrast Security | Most accurate; lowest false positive rate; real-time feedback | Complex to deploy; performance overhead |
| SCA Software Composition |
Third-party dependencies and libraries | Every build | govulncheck, Snyk, Dependabot |
Finds CVEs in dependencies you didn't write | Only finds known CVEs β zero-days not covered |
| Fuzzing Mutation Testing |
Random/malformed/unexpected inputs | Development phase | go-fuzz, AFL |
Finds unexpected crashes and potential zero-days | Time-intensive; requires test harness setup |
DevSecOps Pipeline Sequence
gosec SAST + Semgrep OWASP rules β static analysis of source code
govulncheck SCA + go test β dependency CVE scan + unit/integration tests
Security Gates β Block vs Warn
Correct: BLOCK on Critical (exit code 1)
CI pipeline fails. PR cannot merge. Engineer must resolve the finding before the PR proceeds. This is a real security control.
Example: govulncheck || exit 1 β merge blocked until CVE is resolved
Wrong: Warning-Only Mode
CI prints a warning but passes with exit code 0. Engineers ignore warnings. Critical CVEs reach production. This is security theater, not a security control.
If SAST/SCA only warns, it provides the illusion of security without the protection.
Code Review Security Checklist
Key Terms
- SAST = source code analysis (high false positive rate β requires human triage). Does NOT need a running app.
- DAST = live running application, tested from outside (fewer false positives β tests what's actually running at runtime).
- SCA = third-party libraries and dependencies (CVEs in code you didn't write). SAST = YOUR source code.
- Fuzzing = random/malformed inputs to find unexpected behavior (crashes, memory corruption, potential zero-days).
- Security gates MUST block (exit code 1) on Critical findings β warning-only mode is not a security control.
Platform C Go services pipeline (all steps block on failure):
gosecGo SAST β block on HIGH/CRITICAL findings (not advisory mode)Semgrepwith OWASP Go rules β block on p0 (critical priority) findingsgovulncheckSCA β block on Critical CVEs in Go modulesTruffleHogβ block if any secret detected in git commit history (scan all commits, not just latest)Trivycontainer scan β block if Critical CVE in Docker image
Platform A Java legacy: Add OWASP Dependency Check Maven plugin β run weekly (not every build β too slow). Priority: audit for Log4j 1.x and Log4j 2.x < 2.17.1. Replace with Logback/SLF4J. Target: Java 21 migration to get modern tooling support.
Practice Quiz
Q1. SAST vs SCA β which one finds CVEs in third-party libraries, and which analyzes your own source code?
βΌ Reveal Answer
Q2. Why does DAST find authentication and authorization issues that SAST typically misses?
βΌ Reveal Answer
Q3. An engineer configures gosec to run in warning-only mode (exit 0 even on Critical findings) to reduce CI failures. Why is this a security problem?
βΌ Reveal Answer
Q4. What does TruffleHog detect, and why must it scan the full git history rather than just the latest commit?
βΌ Reveal Answer
Q5. Fuzzing β what type of security bugs does it find that SAST and SCA cannot?