A DevSecOps pipeline is a CI/CD pipeline with automated security checks at every stage, from code commit to runtime. It runs secret scanning and static analysis on pull requests, dependency and container scanning at build, infrastructure and policy checks before deployment, dynamic testing in staging, and runtime monitoring in production. The goal is to catch flaws early, block only high-risk issues, and give developers fast, fixable feedback.
Key takeaways
- A DevSecOps pipeline adds security gates to code, build, test, deploy and runtime, not a separate security step at the end.
- Shift left: the cheapest place to fix a flaw is in the editor or pull request, not in production.
- Block only critical and exploited issues at first, or developers will bypass the gates.
Most teams do not ship insecure software because they do not care about security. They ship it because security arrives too late: a review in the final week, a scan the night before release, a finding nobody has time to fix.
What is a DevSecOps pipeline?
A DevSecOps pipeline is a CI/CD pipeline with automated security checks at every stage, from code commit to runtime, so flaws are caught while they are cheap to fix rather than after release.
DevOps made delivery fast and repeatable. DevSecOps keeps that speed and adds security as code: the same automation that builds and tests your software also scans it, signs it and checks it against policy before it reaches production.
NIST describes this approach in its Secure Software Development Framework, which organises secure development into four groups: prepare the organisation, protect the software, produce well-secured software and respond to vulnerabilities, in SP 800-218. A DevSecOps pipeline is the practical way to run those practices on every commit.
What are the stages of a DevSecOps pipeline?
The pipeline follows the software lifecycle: plan, code, build, test, release, deploy and operate. Each stage gets one security checkpoint, with a clear gate that either passes, warns or blocks.
| Stage | Security checkpoint | Typical gate |
|---|---|---|
| Plan | Threat modelling, security requirements | High-risk changes need a security review |
| Code | SAST, secret scanning, code review | No merge with secrets or critical SAST findings |
| Build | SCA, SBOM, container scanning, signing | Block exploited or critical dependencies; sign the artefact |
| Test | DAST, API testing, fuzzing | Critical findings fail the release candidate |
| Release | Policy as code, penetration testing | Exceptions recorded with owner and expiry |
| Deploy | IaC and Kubernetes policy checks | Unsigned images or non-compliant config rejected |
| Operate | Runtime detection, monitoring, rescans | New vulnerabilities feed the backlog with service levels |
How do you secure the code stage?
Secure the code stage with three controls: secret scanning on every commit, static analysis on every pull request, and a human review that includes security. Together they stop the most common early flaws.
Secret scanning finds passwords, API keys and tokens accidentally committed to code. A leaked key is one of the easiest ways into a company, so this check should run on every push and block the push when it finds a real secret.
Static Application Security Testing, or SAST, reads source code without running it and flags flaws such as SQL injection, cross-site scripting and insecure cryptography. Run it in the editor for instant feedback and again on the pull request as a gate.
Branch protection matters too: require pull-request reviews, signed commits and least-privilege access to the repository. No change should reach the main branch unreviewed.
How do you secure the build stage?
Secure the build stage by scanning what you build from, not just what you write. Modern applications are mostly open-source libraries, so dependency and container checks are where most known vulnerabilities hide.
Software Composition Analysis, or SCA, lists every dependency, flags known vulnerabilities and risky licences, and suggests fixes. Tools in this space include Snyk, Mend and Dependabot. Generate a Software Bill of Materials, or SBOM, at the same time, so you can answer which versions you shipped when a new vulnerability appears.
Container scanning checks images for vulnerable operating-system packages, misconfigured permissions and unnecessary tools. Scan at build time with Trivy or Grype, and do not ship an image with a known exploited vulnerability.
Finally, sign the artefact. Signing with Cosign and Sigstore proves the artefact is genuine and untampered, and admission controls can reject unsigned images at deployment.
What about infrastructure and policy as code?
Infrastructure as code is code, so scan it like code. Misconfigured infrastructure is a leading cause of cloud breaches, and a Terraform or Kubernetes file that opens a storage bucket to the public is a flaw, not a deployment detail.
Tools such as Checkov scan Terraform, CloudFormation and Kubernetes manifests before they reach production, checking for open buckets, root containers and missing encryption. Run the scan on pull requests, so the fix happens before the infrastructure exists.
Policy as code turns security rules into automated checks: only signed images may deploy, only approved regions may be used, and production namespaces must have resource limits. Define the policy once, enforce it everywhere, and record exceptions with an owner and an expiry date.
How do you test a running application?
Dynamic Application Security Testing, or DAST, tests a running application from the outside, like an attacker would. It sends requests, follows links and looks for flaws that only appear when the application runs.
OWASP ZAP is the common open-source choice for DAST in CI, and it can run a baseline scan against a staging environment on every release candidate. Add API security testing if you expose APIs, because APIs are now a frequent attack path.
DAST complements SAST and SCA rather than replacing them. SAST finds flaws in code, SCA finds flaws in libraries, and DAST finds flaws in the running system, including configuration and authentication issues. Use all three, but do not block a release on every low-severity DAST finding.
How do you secure deployment and runtime?
Secure deployment with GitOps where possible: Git is the source of truth for what runs in production, and a tool such as Argo CD continuously compares the cluster to the repository and corrects drift. Every change is reviewed, auditable and reversible.
At admission, verify signatures and policy before a workload starts. Unsigned images, images from unapproved registries and non-compliant configuration should be rejected automatically, not discovered in an audit months later.
In operation, watch for runtime threats with detection, logging and SIEM or XDR monitoring. New vulnerabilities found in production should feed back into the backlog with a service level, so the pipeline improves rather than just reporting the same issue again.
The global average breach cost was USD 4.44 million in 2025, according to IBM, and faster identification and containment drove the first decline in five years. Runtime detection is what buys that speed.
Which DevSecOps tools fit each job?
Aim for one tool per job, integrated with your source control and CI platform, rather than many overlapping scanners. Choose by language coverage, false-positive rate and how findings reach developers.
| Job | What it does | Examples |
|---|---|---|
| SAST | Scans source code for insecure patterns | GitHub CodeQL, SonarQube, Semgrep, Snyk Code |
| Secret scanning | Finds keys and tokens in code | Gitleaks, TruffleHog, GitHub secret scanning |
| SCA | Scans dependencies for known CVEs | Snyk, Mend, Dependabot, OWASP Dependency-Check |
| Container scanning | Scans images for vulnerable packages | Trivy, Grype, Anchore |
| IaC scanning | Scans Terraform and Kubernetes files | Checkov, tfsec |
| DAST | Tests the running application | OWASP ZAP, Burp Suite |
| Signing | Proves an artefact is genuine | Cosign, Sigstore, SLSA |
| CI orchestration | Runs every check and enforces gates | GitHub Actions, GitLab CI, Jenkins, Azure DevOps |
Start with the tools your platform already provides. GitHub Advanced Security and GitLab built-in scanning are often enough for the first three gates, and they put findings where developers already work: in the pull request.
While you build the pipeline, keep the basics in place for the wider business. Our small business cybersecurity checklist covers backups, updates and access controls alongside secure development.
Also check your public-facing services with the free SSL checker to catch expired or misconfigured certificates before they break a deployment.
How do you build a DevSecOps pipeline in 30 days?
Do not try to build the full pipeline in one sprint. Build it in four weekly steps, and fix the findings at each step before you add the next gate.
- Week 1 — code gates. Enable secret scanning and SAST on pull requests for one repository. Require reviews and branch protection. Fix critical findings and tune false positives.
- Week 2 — build gates. Add SCA, SBOM generation and container scanning. Block only known exploited or critical dependencies. Start signing artefacts.
- Week 3 — deployment gates. Add IaC scanning and policy checks. Require signed images at admission. Run DAST against staging on release candidates.
- Week 4 — runtime and feedback. Connect runtime alerts to the backlog, set service levels for new vulnerabilities, and review which gates blocked real issues and which only created noise.
Measure three things: time from commit to feedback, percentage of pull requests blocked by a real finding, and time to fix a critical vulnerability. If feedback takes hours, developers will work around the pipeline. If it takes minutes, they will trust it.
What mistakes slow a DevSecOps pipeline down?
The biggest mistake is blocking on everything. A pipeline that fails a build for a low-severity finding in a test file teaches developers to bypass it. Block on critical and exploited issues, and send the rest to the backlog with an owner.
Another mistake is buying scanners before fixing the workflow. A new tool that reports into a dashboard nobody reads adds noise, not security. Put findings in the pull request, with a suggested fix, and the tool will be used.
A third mistake is ignoring the supply chain. An SBOM, signed artefacts and dependency updates matter as much as code scanning, because most modern breaches start in a library, a container image or a build step. NIST's SSDF includes provenance and vulnerability response as core practices for exactly this reason.
The bottom line
A DevSecOps pipeline is not a product you buy. It is a set of automated gates — secret scanning, SAST, SCA, container and IaC scanning, DAST, signing and runtime monitoring — run on every commit, with fast feedback and clear rules about what blocks a release.
Start with one repository and three gates, fix what they find, then add the next stage. You can check your own public-facing security while you build it with the free security headers checker.
Frequently asked questions
What is a DevSecOps pipeline?
It is a software delivery pipeline that runs automated security checks at every stage, from writing code to running it in production. Each stage has a gate: secret scanning, static analysis, dependency scanning, container scanning, infrastructure checks, dynamic testing and runtime monitoring.
What is the difference between DevOps and DevSecOps?
DevOps focuses on speed and reliability of delivery. DevSecOps adds security to the same pipeline, with the same automation and shared ownership. Security is not a separate team that reviews code at the end, but a set of automated checks that developers and operations run together.
What are the stages of a DevSecOps pipeline?
The usual stages are plan, code, build, test, release, deploy and operate. Security checks map to each one: threat modelling in planning, SAST and secret scanning in code, SCA and container scanning in build, DAST in test, signing and policy gates in release, and runtime detection in operation.
What tools are used in a DevSecOps pipeline?
Common tools include GitHub Advanced Security and CodeQL or SonarQube for SAST, Snyk or Dependabot for dependencies, Trivy or Grype for containers, Checkov for infrastructure as code, OWASP ZAP for DAST, and Cosign with Sigstore for signing. Choose one tool per job, not three overlapping scanners.
What is shift left in DevSecOps?
Shift left means moving security checks earlier in development, into the editor and the pull request. A flaw found in code review costs far less to fix than the same flaw found in production, and developers get feedback while the code is still fresh in their minds.
How do you start building a DevSecOps pipeline?
Start with one repository and three gates: secret scanning, SAST on pull requests and dependency scanning on build. Fix the critical findings, tune out false positives, then add container, infrastructure and dynamic testing. Add policy as code only after the basic gates are stable.
What is SAST, SCA and DAST?
SAST scans source code without running it. SCA scans open-source dependencies for known vulnerabilities. DAST tests a running application from the outside, like an attacker would. A mature pipeline uses all three, because each finds flaws the others miss.
Does DevSecOps slow down developers?
It can, if every finding blocks a release. The fix is to block only critical, exploitable issues, give developers a clear fix in the pull request, and move lower-risk findings to the backlog with an owner and a date. Fast feedback is the point, not more gates.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against NIST SP 800-218 SSDF practices and the IBM 2025 Cost of a Data Breach Report.
How we write and fact-check →