Module 7 · SAST, DAST, and Security in the CI/CD Pipeline

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
May 14, 2026
3 min read
Read as
100% Free

No signup. No paywall. No catch. One of our 10 most-requested practitioner modules — published in full so anyone can learn for free. We earn through consulting, not by gating knowledge.

See all 10 free modules →

Why this module exists. Static and dynamic application security testing in CI/CD is how modern programmes catch security defects before production. This module covers the tool landscape, where each fits in the pipeline, and the realistic tuning required to get signal-to-noise ratios that engineers will actually use.

Why this module exists. SAST that produces 1000 false positives per scan trains developers to ignore findings. SAST tuned and triaged surfaces real bugs caught before merge. The difference is operational discipline, not tool choice.

The testing pyramid for AppSec

Tool class When Catches
SAST In IDE / pre-commit / PR Code-level bugs (injection, crypto misuse, unsafe APIs)
SCA PR / build Vulnerable dependencies (Module 6)
Secret scanning Pre-commit + PR API keys, certs, passwords in code
IaC scanning PR / build Terraform / K8s manifest misconfig
Container scanning Build Image vulnerabilities, malicious layers
DAST Post-deploy / staging Runtime issues, real-traffic auth flows
IAST In test environments Hybrid of SAST + DAST signal

SAST — what works in 2026

  • Semgrep: open-source, rule-based, fast. Most-used SAST in cloud-native shops. Strong custom-rule support.
  • CodeQL: GitHub-integrated, semantic analysis. Powerful for complex queries; learning curve.
  • Snyk Code, Veracode, Checkmarx, Fortify: commercial. Broader rule sets; higher cost; varies on noise-vs-signal.

Run in PR; block merge on high-confidence findings only. Lower-confidence findings logged for triage, not blocking.

The noise problem and how to fix it

  1. Start with the highest-precision ruleset (Semgrep registry’s “p/security-audit” or equivalent).
  2. For 30 days, triage every finding. Mark false-positives.
  3. Disable rules that produce only false-positives in your codebase.
  4. Add custom rules for project-specific patterns (your internal SDK, your auth library).
  5. Track signal-to-noise ratio per rule; iterate.

The target: >70% of findings should be actionable. Below this, developers ignore the tool.

Secret scanning — the gitleaks pattern

# Pre-commit hook
# .pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
  rev: v8.18.0
  hooks:
  - id: gitleaks

# Or GitHub native — Push Protection
# Settings → Code security → Push protection: enabled
# Blocks commits containing known secret patterns at push time

# If a secret reaches main: assume compromised, rotate immediately

Secrets in git history persist forever. Rotation is the only remediation; rewriting history rarely works because forks and clones retain copies.

IaC scanning

Terraform / CloudFormation / Kubernetes manifest misconfigurations are routinely scanned for:

  • tfsec / Checkov: open-source Terraform scanning.
  • Kubescape / Kyverno CLI: Kubernetes manifest scanning.
  • Trivy: covers IaC alongside other targets.

Findings include: S3 buckets without encryption, security groups with 0.0.0.0/0, K8s pods running as root, IAM policies too broad.

DAST — the realistic version

  • OWASP ZAP: open-source. Run in CI in baseline mode against staging environment.
  • Burp Suite Enterprise: commercial; better for complex authenticated flows.
  • Acunetix, Netsparker: commercial, scheduled scans.

DAST is slower than SAST and runs against running applications. Run nightly against staging; full-coverage runs weekly. Block on high-confidence findings.

The pipeline gate strategy

  • Pre-commit: lint + secret detection. Fast, local, no CI cost.
  • PR build: SAST + SCA + IaC scan. 5-15 minutes. Findings reported as PR comments.
  • Merge to main: comprehensive SAST + container scan. Block on critical findings.
  • Deploy to staging: DAST nightly + IAST during integration tests.
  • Deploy to prod: image signing verification + final go/no-go.

The exception process

Sometimes findings cannot be fixed immediately. The exception flow:

  • Developer requests exception via PR comment or ticket.
  • AppSec engineer reviews; either fixes, justifies false positive, or accepts with expiry.
  • Accepted exceptions logged with reason and expiry.
  • Quarterly exception review; re-evaluate or close.

Common failure modes

  • Tool produces 10,000 findings on day 1; team disables it instead of triaging.
  • SAST result blocking PR but no clear path to remediation — developers bypass via “skip CI” labels.
  • DAST scan misses auth-protected endpoints because login flow not configured.
  • Exception list grows indefinitely; never reviewed.

Key takeaways

  • Pyramid: SAST in PR, SCA in PR, secret scan in pre-commit, IaC scan in PR, DAST in staging, IAST integration.
  • SAST: Semgrep + CodeQL as default cloud-native combination; commercial for broader scope.
  • Tune for >70% actionable findings; otherwise developers ignore.
  • Secret scanning in pre-commit + GitHub Push Protection; rotation is the only remediation if a secret slips through.
  • DAST nightly against staging; comprehensive weekly.
  • Pipeline gates: pre-commit, PR build, merge, deploy. Each layer adds different signal.
Need a real pentest?

Get a VAPT scoping call

Senior practitioner-led VAPT — not a checklist run by juniors. CVSS-scored findings, free retest, attestation letter. India's SMBs and SaaS teams.

Book VAPT scoping call Replies in 4 working hrs · India-only · Senior consultants