# Shift-Left Security: SAST, SCA and DAST

> Add automated security testing to pipelines, from source code and dependencies to IaC, containers and running applications. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/security-scanning
Last updated: 2026-11-28

Add automated security testing to pipelines, from source code and dependencies to IaC, containers and running applications.

Intermediate · about 6 hours · difficulty 3/5

Learn first: [Continuous Integration and Delivery](https://www.internhack.in/roadmaps/tracks/devops/ci-cd-concepts), [Container Security Essentials](https://www.internhack.in/roadmaps/tracks/devops/container-security)

**DevSecOps** means security is part of the everyday pipeline instead of a gate at the end. The practical core is a set of automated scanners, each looking at a different layer, plus a sane process for acting on what they find.

### Know the common web risks

The **OWASP Top 10** (broken access control, injection, cryptographic failures, misconfiguration, vulnerable components and so on) is the shared vocabulary between developers and security teams. You do not need to be a pentester, but you should recognise each class.

### Types of scanning

- **Secret scanning**: gitleaks, trufflehog, Git host push protection.
- **SAST** (static analysis of source): Semgrep, CodeQL, SonarQube. Finds injection patterns and unsafe APIs before code runs.
- **SCA** (software composition analysis): Dependabot, Renovate, Snyk, OSV-Scanner, `npm audit`. Finds known CVEs in dependencies and keeps them updated.
- **IaC scanning**: Checkov, Trivy, tfsec rules. Catches public buckets and open security groups at plan time.
- **Container image scanning**: Trivy, Grype, registry-native scanners.
- **DAST** (dynamic testing of a running app): OWASP ZAP against staging finds missing headers, auth issues and reflected input.

### Making it work in practice

- Run fast scanners on every pull request and slower ones nightly.
- Fail builds only on high-confidence, high-severity findings at first; report the rest.
- Triage with **severity and exploitability**, and track exceptions with expiry dates.
- Automate dependency updates so patches arrive as small, reviewable pull requests.

**Good enough to move on:** you can add secret, SAST, SCA, IaC and image scanning to a pipeline with a sensible failure threshold, run a ZAP baseline scan against staging, and explain the difference between SAST and DAST.

## Key concepts

- **OWASP Top 10**
- **Secret scanning**
- **SAST with Semgrep or CodeQL**
- **SCA and automated dependency updates**
- **IaC scanning with Checkov or Trivy**
- **Container image scanning**
- **DAST with OWASP ZAP**
- **Triage, thresholds and exceptions**

## Mini project

Add gitleaks, Semgrep, Dependabot or Renovate, Checkov and Trivy to a repository's pipeline, fail only on critical findings, and run a nightly OWASP ZAP baseline scan against a staging deployment.

## Check yourself

Which scanner type would catch a SQL injection in your code, which would catch a vulnerable version of a logging library, and which would catch a missing security header?

## Free resources

- [OWASP Top Ten](https://owasp.org/www-project-top-ten/) (OWASP)
- [Semgrep documentation](https://semgrep.dev/docs/) (Semgrep)
- [Trivy documentation](https://trivy.dev/latest/docs/) (Aqua Security)
- [ZAP documentation](https://www.zaproxy.org/docs/) (ZAP)

Previous: [Chaos Engineering](https://www.internhack.in/roadmaps/tracks/devops/chaos-engineering) · Next: [Software Supply Chain Security](https://www.internhack.in/roadmaps/tracks/devops/supply-chain-security)

## More in DevSecOps and Supply Chain Security

- [Shift-Left Security: SAST, SCA and DAST](https://www.internhack.in/roadmaps/tracks/devops/security-scanning)
- [Software Supply Chain Security](https://www.internhack.in/roadmaps/tracks/devops/supply-chain-security)
- [Identity, Access and Least Privilege](https://www.internhack.in/roadmaps/tracks/devops/iam-least-privilege)
- [Policy as Code and Compliance](https://www.internhack.in/roadmaps/tracks/devops/policy-as-code)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
