6x
faster vulnerability remediation in organizations with mature DevSecOps programs (DORA 2023)
85%
of developers say security reviews slow delivery — the key problem DevSecOps solves
60%
of breaches involve vulnerabilities for which a patch was available
45 minutes
average time a leaked secret remains active before exploitation (GitGuardian 2024)

DevSecOps is the integration of security practices into DevOps workflows, with the goal of finding and fixing security issues as early in the development lifecycle as possible. The 'shift left' metaphor refers to moving security checks earlier in the development pipeline — to the left on a timeline — where fixes are fastest and cheapest. The failure mode of most DevSecOps programs is implementing security tooling that blocks the pipeline with high false-positive rates, creating an adversarial relationship between security and engineering. This guide covers how to implement the core DevSecOps toolchain with a developer experience that security can actually sustain.

The DevSecOps Toolchain: What Goes Where

DevSecOps integrates multiple security testing types at different pipeline stages. Each tool has a different role, different latency profile, and different false-positive characteristics.

Pre-commit hooks (IDE and local)

Secret detection and basic linting run locally before code is committed. Catching a hardcoded API key before it touches version control is the highest-value intervention. Tools: git-secrets, Gitleaks, pre-commit framework with security hooks. Latency: milliseconds. False-positive rate: low for secrets; accept developer override for false positives with documented justification.

Pull request / merge request gates (CI)

SAST, SCA, and IaC scanning run on every PR. Results are posted as PR comments for immediate developer feedback. Gate behavior: block on new critical/high findings; warn on medium. Never block on informational or findings that existed before this PR. Latency: 2-10 minutes acceptable; beyond 15 minutes creates pipeline friction.

Build artifact scanning (CI/CD)

Container image scanning and dependency vulnerability scanning run against the built artifact — catching issues that source-level scanning misses. Results gate promotion from dev to staging. Latency: 3-15 minutes for container scans.

Dynamic testing (staging environment)

DAST and API security testing run against a deployed staging environment. Cannot run in the PR gate (no running application to test). Integrated into the deployment pipeline between staging and production promotion. Latency: 15-60 minutes for targeted DAST scans.

Production monitoring (continuous)

RASP (Runtime Application Self-Protection), WAF monitoring, and dependency vulnerability tracking continue in production. New CVEs published against deployed dependencies trigger alerts outside of pipeline scans.

Static Application Security Testing (SAST)

SAST analyzes source code without executing it, identifying vulnerability patterns: SQL injection, XSS, insecure deserialization, path traversal, hardcoded credentials, and insecure API usage.

How SAST works

SAST tools parse source code into an abstract syntax tree (AST) or intermediate representation, then apply pattern matching and data flow analysis to identify vulnerability-prone code patterns. Data flow analysis traces tainted user input through the application to identify injection sinks — more accurate than pattern matching alone, but slower.

Language coverage

SAST tools are language-specific. Semgrep, Checkmarx, Veracode, and SonarQube support multiple languages; choose based on your primary stack. Open source tools (Semgrep, CodeQL) have community rule sets for common languages; commercial tools provide broader coverage and managed rule libraries.

Managing false positives

SAST false-positive rates of 30-50% are common with out-of-box configurations. The pipeline integration strategy must account for this: show findings as informational by default; require security team review before promoting any finding to a blocking gate. Suppress confirmed false positives with inline comments (// nosec, // nolint) with documented justification.

Developer experience matters

SAST feedback delivered as PR comments with clear remediation guidance and links to documentation sees 3-5x better developer remediation rates than findings delivered through a separate security portal. Meet developers where they work: GitHub/GitLab PR integration is non-negotiable.

Free daily briefing

Briefings like this, every morning before 9am.

Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.

Software Composition Analysis (SCA)

SCA identifies known vulnerabilities in open source dependencies — the third-party code that comprises 70-90% of most applications. SCA produces a vulnerability list keyed to specific package versions.

SCA vs. SAST

SAST analyzes first-party code for security flaws; SCA analyzes third-party dependencies for known CVEs. Both are needed. The Log4Shell vulnerability (CVE-2021-44228) was an SCA finding — the vulnerability was in a dependency, not application code.

Reachability analysis

Naive SCA reports every CVE in every dependency, including transitive dependencies. This produces overwhelming alert volumes. Reachability analysis (Snyk, Endor Labs, Semgrep Supply Chain) determines whether the vulnerable code path is actually reachable in the application — dramatically reducing false positives.

License compliance

SCA tools also identify open source license types. GPL-licensed dependencies in a commercial product may create license obligation issues. SCA license scanning is a legal/compliance function alongside security.

Tooling

Dependabot (GitHub native, free), Snyk, OWASP Dependency-Check (open source), and Checkmarx SCA are common choices. Dependabot's automated PR creation for dependency updates is the simplest path to remediation for GitHub-hosted repositories.

Secrets Detection: Preventing Credential Leaks

Hardcoded secrets in source code are one of the most consistently exploited initial access vectors. The average exposed secret is exploited within 45 minutes of being committed to a public repository. Prevention requires detection at the commit layer, not after the fact.

Pre-commit detection

Gitleaks and git-secrets run as pre-commit hooks, scanning staged files for secret patterns before commit. Prevent the secret from ever entering version control. This is the highest-value intervention point.

Repository scanning

Scan existing repositories for historical secret exposure. GitHub Advanced Security secret scanning, GitGuardian, and Trufflehog scan the full commit history. Organizations that have never run historical scanning consistently find secrets committed years ago that are still valid.

Secret pattern libraries

Good secrets detectors ship with pattern libraries for hundreds of credential types: AWS access keys, GitHub tokens, Stripe API keys, Slack webhooks, database connection strings. Custom patterns can be added for organization-specific credential formats.

Response workflow

When a secret is detected in an existing commit, the response is not deletion (commits are immutable in git; history rewriting affects collaborators). The response is: immediately revoke and rotate the credential, scan for unauthorized use of the exposed credential in audit logs, and document the incident. Prevention is easier than response.

Infrastructure as Code (IaC) Security

IaC (Terraform, CloudFormation, Bicep, Pulumi) defines cloud infrastructure in code checked into version control. Misconfigured IaC is the source of the majority of cloud security incidents — public S3 buckets, overprivileged IAM roles, open security groups, unencrypted storage. IaC scanning catches these misconfigurations at design time.

IaC scanning tools

Checkov (Bridgecrew/Palo Alto), Trivy IaC, tfsec, and KICS scan IaC templates for security misconfigurations before they are deployed. These tools check against CIS benchmarks and cloud provider security best practices. Integrate in the PR gate — the misconfiguration has zero cost to fix before deployment; it has significant cost after.

Policy as code

OPA (Open Policy Agent) and Sentinel (HashiCorp) allow organizations to write custom security policies as code that enforce organization-specific requirements: 'all S3 buckets must have public access blocked,' 'all IAM roles must have a maximum session duration of 4 hours.' Policy-as-code makes security requirements enforceable at the infrastructure layer without manual review.

Drift detection

IaC scanning prevents misconfigurations at deploy time; drift detection catches manual changes made directly through the cloud console that deviate from the IaC-defined state. AWS Config, Azure Policy, and commercial tools (Wiz, Orca) detect configuration drift in running infrastructure.

Container Image Scanning

Container images bundle application code, dependencies, and base OS — each a potential vulnerability source. Container scanning identifies CVEs in all layers of the image before it is deployed.

What container scanning covers

OS package vulnerabilities in the base image (Ubuntu, Alpine packages), application dependencies bundled in the image, and hardcoded secrets or credentials embedded in image layers. Trivy, Grype, Snyk Container, and Amazon ECR scanning are common tools.

Minimal base images

The attack surface of a container image is proportional to the number of packages it contains. Distroless images (Google) and Alpine-based images have dramatically fewer packages than full Ubuntu or Debian images, producing fewer vulnerabilities by default. Use minimal base images for production containers.

Image signing and verification

Cosign (Sigstore) signs container images with a cryptographic signature. Admission controllers (Kyverno, OPA Gatekeeper) in Kubernetes clusters can verify image signatures before allowing pod creation, preventing unsigned or tampered images from running in production.

Registry scanning vs. runtime scanning

Registry scanning catches vulnerabilities before deployment; runtime scanning (Falco, Aqua) catches exploit attempts against deployed containers. Both are required — registry scanning misses zero-days published after image build; runtime scanning catches exploitation of known vulnerabilities that bypassed registry gates.

Dynamic Application Security Testing (DAST)

DAST tests running applications by sending malicious inputs and observing responses — it finds vulnerabilities that SAST misses because it tests the actual running application, not source code.

DAST in CI/CD

DAST requires a running application, so it cannot run in the PR gate. Integrate DAST into the deployment pipeline between staging and production: deploy to staging, run targeted DAST scans against the staging environment, gate production promotion on DAST findings. Full DAST scans take 30-90 minutes; targeted API scans can complete in 10-15 minutes.

DAST tooling

OWASP ZAP (open source), Burp Suite Enterprise, and StackHawk are the common CI/CD-integrated DAST tools. StackHawk and Burp Enterprise are designed specifically for pipeline integration with API-based scan triggering and results export.

DAST vs. SAST coverage

DAST finds: authentication bypass, session management flaws, reflected XSS, SSRF, business logic vulnerabilities, and configuration issues that only manifest in a running environment. SAST finds: static code patterns, injection flaws in code, and hardcoded values. Running both provides coverage neither achieves alone.

The bottom line

DevSecOps implementation requires choosing the right tool for each pipeline stage, configuring false-positive rates to acceptable levels before blocking gates, and designing developer feedback that is actionable rather than overwhelming. The DevSecOps toolchain that generates 500 alerts per PR that developers learn to ignore is worse than no toolchain at all. Start with secrets detection (highest impact, lowest false-positive rate), add SCA (high signal for known CVEs), then SAST with tuning, then IaC scanning, then DAST. Each addition should demonstrate value before the next is added.

Frequently asked questions

What is DevSecOps?

DevSecOps is the integration of security practices into DevOps workflows, making security a continuous part of the development pipeline rather than a gate at the end of development. It includes automated security testing (SAST, DAST, SCA, secrets detection), security policies in CI/CD pipelines, infrastructure security automation, and shared security responsibility between development, security, and operations teams. The 'shift left' goal is to find and fix security issues earlier in the lifecycle when they are cheaper and faster to remediate.

What is the difference between SAST and DAST?

SAST (Static Application Security Testing) analyzes source code without executing it, finding vulnerability patterns in the code itself. DAST (Dynamic Application Security Testing) tests a running application by sending attack inputs and observing responses. SAST runs early in the pipeline (PR gate) and finds code-level issues; DAST runs against a deployed staging environment and finds runtime issues that SAST cannot detect. Both are needed for comprehensive coverage.

What is SCA and why does it matter?

SCA (Software Composition Analysis) identifies known vulnerabilities in open source dependencies — the third-party libraries and packages that make up the majority of most applications. SCA tools scan the dependency manifest (package.json, requirements.txt, pom.xml) and compare versions against vulnerability databases. Without SCA, organizations are blind to vulnerabilities in the code they did not write — which is the majority of their attack surface. Log4Shell was an SCA-detectable vulnerability.

How do you prevent false positives from blocking the pipeline?

Gate strategy is the key: block on new critical/high findings from the current PR only — never on findings that pre-existed the current change. Use informational mode first to baseline false-positive rates before enabling any blocking. Suppress confirmed false positives with inline annotations (with documented justification). Set different thresholds for different environments: PR gates block on critical; production gates block on high+. Keep SAST false-positive rates below 15% before enabling blocking — otherwise developers will route around the gate.

How should secrets be handled if found in a git repository?

If a secret is found in git history: (1) immediately revoke and rotate the credential — assume it has been accessed; (2) check audit logs for the credential for unauthorized use; (3) do not try to erase the secret from git history as a substitute for rotation — history rewriting is disruptive and unreliable. Going forward, pre-commit secrets detection prevents secrets from entering version control. For existing repositories, run a full historical scan with Trufflehog or GitGuardian to find secrets committed in the past.

What is IaC security scanning?

Infrastructure as Code (IaC) security scanning analyzes Terraform, CloudFormation, Bicep, and other IaC templates for security misconfigurations before they are deployed to cloud environments. Tools like Checkov, tfsec, and Trivy check IaC templates against CIS benchmarks and cloud security best practices — finding public S3 buckets, overprivileged IAM roles, open security groups, and unencrypted storage in the PR gate, before the misconfiguration is deployed. IaC misconfigurations are free to fix before deployment; they are expensive to fix after a breach.

Sources & references

  1. NIST — DevSecOps Fundamentals
  2. OWASP — DevSecOps Guideline
  3. CISA — Shifting the Balance of Cybersecurity Risk
  4. Google — DORA State of DevOps Report

Free resources

25
Free download

Critical CVE Reference Card 2025–2026

25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.

No spam. Unsubscribe anytime.

Free download

Ransomware Incident Response Playbook

Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.

No spam. Unsubscribe anytime.

Free newsletter

Get threat intel before your inbox does.

50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, weekly, no spam.

Unsubscribe anytime. We never sell your data.

Eric Bang
Author

Founder & Cybersecurity Evangelist, Decryption Digest

Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals weekly.

Free Brief

The Mythos Brief is free.

AI that finds 27-year-old zero-days. What it means for your security program.

Joins Decryption Digest. Unsubscribe anytime.

Daily Briefing

Get briefings like this every morning

Actionable threat intelligence for working practitioners. Free. No spam. Trusted by 50,000+ SOC analysts, CISOs, and security engineers.

Unsubscribe anytime.

Mythos Brief

Anthropic's AI finds zero-days your scanners miss.