Join our Newsletter — 33% off our NHI Course
Home› Guides› DevSecOps Guide: Building Security into the Delivery Pipeline
Guide Application Security

DevSecOps Guide: Building Security into the Delivery Pipeline

PDF for newsletter subscribers · free to read online

← All guides
By Lalit Choda, NHI Mgmt Group Updated 24 October 2026 16 min read
On this page

Most DevSecOps programmes fail not for lack of scanners but because security checks are bolted onto pipelines without owners, thresholds or a way to measure whether risk is actually going down. DevSecOps means treating security requirements, tests and release integrity as part of the normal delivery flow, so the same automation that builds and deploys software also proves it is safe enough to ship. This guide covers the operating model, the toolchain and where each check belongs, how to set gates without stalling delivery, a phased rollout, metrics, and how the practice maps to NIST SSDF, SLSA, OWASP SAMM and NIST SP 800-53. It is written for application security leads, platform engineers and engineering managers who own a delivery pipeline. Hardening the pipeline platform itself and the identities inside it are covered in separate guides linked below.

Key takeaways

  • Start from a framework, not a tool list. NIST SSDF (SP 800-218) gives 19 practices across four groups; map every pipeline check to one so gaps and duplicates are visible.
  • Put each check where it is cheapest to act on. Secrets and fast static checks belong in the IDE and pull request; slow dynamic tests belong after deployment to a test environment.
  • Gates need written criteria. SSDF PO.4 asks you to define and use criteria for software security checks: block only on high-confidence, high-impact findings and track the rest as debt.
  • Release integrity is part of DevSecOps. Signed artefacts, build provenance (SLSA Build L2 or L3) and an SBOM per release turn "we scanned it" into evidence a consumer can verify.
  • Measure flow and outcomes together. Track time to remediate, escaped vulnerabilities and gate override rates next to deployment frequency, or security will be blamed for every delay.

What DevSecOps covers and what it does not

DevSecOps is an operating model, not a product category. It has three parts that must all be present for the term to mean anything:

  • Shared ownership: delivery teams own fixing their findings; security owns the standards, the tooling platform and the exceptions process. The NCSC's secure development and deployment guidance opens with the principle that secure development is everyone's concern.
  • Automated, repeatable checks: security tests run on every change through the same pipeline as unit tests, with results written back to the pull request or ticket where developers already work.
  • Verifiable releases: each release can be traced back to reviewed source, a known build and known components, which is what SSDF PS.2 (verifying release integrity) and PS.3 (archive and protect each release, including provenance data such as an SBOM) require.

It does not replace design work. Threat modelling and security requirements (SSDF PO.1, PW.1, PW.2) still happen before code exists, and penetration testing still finds what automation misses. See the Threat Modelling Guide. Securing the CI/CD platform, runners and their credentials is covered in the CI/CD Security Guide and the CI/CD Pipeline Identity Security Guide, and is not repeated here.

The DevSecOps lifecycle: where each check belongs

The table maps checks to stages of a typical trunk-based pipeline. The principle is to run the fastest, most precise checks earliest, and to reserve blocking for stages where the developer still has context.

StageChecksTypical run timeDefault actionSSDF practice
Plan and designSecurity requirements, abuse cases, threat model for significant changesHours (human)Required for new services and trust boundary changesPO.1, PW.1, PW.2
IDE and pre-commitSecret detection, linting with security rules, AI assistant output reviewSecondsWarn locally; never the only controlPW.5
Pull requestSAST on changed files, software composition analysis (SCA) of new dependencies, secret scan, IaC scan, peer review1 to 10 minutesBlock on verified secrets and critical, reachable findingsPW.4, PW.5, PW.7
BuildFull SAST, compiler hardening flags, container image scan, SBOM generation, provenance and signing5 to 20 minutesBlock on policy failures; fail closed if signing failsPW.6, PS.2, PS.3
Test environmentDAST, API testing, fuzzing for parsers and protocol code20 minutes to hoursTicket by default; block high-confidence criticals before productionPW.8
Release and deploySignature and provenance verification at admission, configuration baseline checksSecondsBlock unsigned or unverified artefactsPS.2, PW.9
OperateContinuous re-scan of deployed images and dependencies against new CVEs, runtime detection, vulnerability disclosure intakeContinuousFeed remediation queue with SLARV.1, RV.2, RV.3

The "DevSecOps funnel" idea follows from this: many cheap checks early catch the bulk of issues, and fewer, slower, deeper checks later catch what remains. If the later stages find most of your issues, the early checks are mis-tuned or missing.

The DevSecOps toolchain by category

Tool categories overlap, and platform suites bundle several. Choose by what the check must prove, then by language coverage and how results reach developers. The Application Security Testing Buyer's Guide covers evaluation in depth.

CategoryWhat it findsStrengthsLimits
SASTInjection, unsafe APIs, crypto misuse in first-party sourceRuns before deployment; points to the lineFalse positives; weak on business logic and configuration
SCAKnown-vulnerable or disallowed-licence dependenciesHigh precision for known CVEs; feeds the SBOMMisses unknown flaws; reachability often not assessed
Secret scanningAPI keys, tokens, private keys in code, history, images and logsCheap, high impact; provider validation reduces noiseFinding is not fixing: the credential must be revoked
IaC scanningMisconfigured Terraform, Kubernetes manifests, Helm charts, DockerfilesStops cloud misconfiguration before it existsPolicy drift between scanner rules and cloud guardrails
Container image scanningVulnerable OS and language packages, embedded secrets, root userCovers what SCA misses in base imagesResults age quickly; needs continuous re-scan
DASTRuntime issues: authentication, session handling, injection, headersLanguage-agnostic; confirms exploitabilityNeeds a deployed target and authenticated crawling; slow
FuzzingMemory safety and parser crashesFinds deep bugs other tools missNeeds harnesses; best for libraries and protocol code
ASPM and dashboardsCorrelated, de-duplicated findings across toolsOne queue, ownership mapping, trend reportingOnly as good as the data feeding it
  • DAST in DevSecOps: run a baseline (passive) scan on every deployment to the test environment and a full authenticated scan nightly or per release. Give the scanner a dedicated test account with a known role, never a production credential. See the Web Application Security Testing Guide.
  • SBOM in DevSecOps: generate the SBOM in the build that produces the artefact, not from source afterwards, and store it with the release so SSDF PS.3.2 is met and re-scans against new CVEs are possible. See the SBOM Guide.
  • Dashboard: aggregate in an ASPM layer or vulnerability management platform keyed by service owner, not by scanner. See the Application Security Posture Management (ASPM) Guide.

Setting security gates that teams accept

SSDF PO.4 asks organisations to define and use criteria for software security checks. In practice that means a written gate policy per stage, versioned in a repository like any other code.

  • Block on precision, not volume: block merges for verified live secrets, critical SCA findings with a fix available, and SAST rules you have tuned to a low false-positive rate. Everything else creates a ticket with an SLA.
  • New code first: apply gates to findings introduced by the change ("diff-aware" or "new code" mode) so legacy debt does not block every merge. Track the legacy backlog separately with a burn-down target.
  • Exceptions are time-boxed: an override needs a named approver, a reason and an expiry date, and is reported. See the Remediation SLAs and Vulnerability Exceptions Guide.
  • Fail closed on integrity steps: if signing, provenance generation or SBOM generation fails, the release fails. These steps are cheap and their absence is a strong signal of tampering or misconfiguration.
  • Protect the gate itself: workflow files that define gates should be protected by CODEOWNERS review, as GitHub recommends for .github/workflows, so a developer cannot remove a check in the same pull request that would fail it.

Choosing between approaches

DecisionOption AOption BChoose A when
ToolingPlatform-native scanners (built into the source control or CI platform)Best-of-breed tools per categoryYou have one main platform and a small AppSec team; choose B for many languages or regulated evidence needs
Gate placementBlocking in pull requestBlocking only at releaseChecks are fast and precise; choose B for slow DAST and fuzzing
Pipeline ownershipCentral reusable pipeline templatesEach team writes its ownAlmost always; B only for small organisations with one or two teams
Signing keysKeyless signing tied to the CI workload identityLong-lived keys in a KMS or HSMYour CI platform issues OIDC tokens; choose B where offline or air-gapped verification is required

Small versus large organisations: a team of 20 engineers can get most of the value from platform-native SAST, SCA, secret scanning and a dependency update tool, plus one reusable pipeline template. Large organisations need a paved road: central templates that teams inherit, an ASPM layer to de-duplicate findings across dozens of tools, a security champions network and service ownership data to route findings. See the Security Champions Programme Guide.

Release integrity: provenance, signing and SLSA

Scanning tells you what is in an artefact; provenance tells you where it came from. SLSA v1.0 defines a Build track with four levels:

  • Build L0: no guarantees.
  • Build L1: a consistent build process that generates provenance describing the build platform, process and top-level inputs, distributed to consumers. SLSA notes this is trivial to bypass or forge; it mainly catches mistakes.
  • Build L2: builds run on a hosted build platform and provenance is signed by that platform, so consumers can detect tampering after the build.
  • Build L3: hardened builds: runs cannot influence one another, and the provenance signing secret is not accessible to user-defined build steps, which protects against tampering during the build and limits the impact of stolen upload credentials.

A realistic target for most organisations is L2 for every production artefact and L3 for anything you distribute to customers. Verify provenance and signatures at deployment, not only at build, or the evidence is never used. The Codecov breach shows why: a modified uploader script ran in thousands of customer pipelines until one customer compared it with the published checksum. See the Software Supply Chain Security Guide for consumer-side verification, and the Container Registry Security Guide for storing and enforcing signatures.

AI and mobile DevSecOps

  • AI coding assistants: code suggested by an assistant goes through the same pull request checks as human code; do not exempt it. Add secret scanning on prompts or context files where the tooling allows, and restrict which repositories agents with write access can push to. See the AI-Generated Code Review Guide and the GitHub Copilot Security Guide.
  • AI features in the product: treat model and dataset components as supply chain inputs with their own inventory. See the AI Supply Chain and AI-BOM Guide.
  • Mobile DevSecOps: mobile builds add signing keys for app stores, binary analysis of the packaged app and checks against the OWASP MASVS control groups (MASVS-STORAGE, MASVS-CRYPTO, MASVS-AUTH, MASVS-NETWORK, MASVS-PLATFORM, MASVS-CODE, MASVS-RESILIENCE, MASVS-PRIVACY). Keep the store signing key out of general-purpose runners and restrict which jobs can use it.

Where identity fits

Every DevSecOps tool is a non-human identity with privileged access: scanners read all source code, dependency bots open pull requests, and release jobs hold publishing and signing credentials. The Checkmarx KICS supply chain attack turned a security scanner image into a collector of secrets inside customer pipelines, and the tj-actions/changed-files compromise (CVE-2025-30066) used a stolen bot token to repoint version tags so that every workflow referencing them ran malicious code.

  • Least privilege for workflow tokens: GitHub recommends defaulting GITHUB_TOKEN to read-only contents and granting more per job; the OpenSSF Scorecard Token-Permissions check tests for this.
  • Federate rather than store: use OIDC from CI to cloud and registries for short-lived credentials. See the Workload Identity Federation Guide.
  • Pin third-party actions and images: by full commit SHA or digest; GitHub notes that workflow dependency lockfiles supersede SHA pinning where they can be adopted.
  • Owners for tool identities: every scanner, bot and release identity needs an owner, scope and rotation record. See the NHI Ownership Guide.

Implementing DevSecOps: a phased rollout

  1. Baseline (weeks 1 to 4): inventory repositories, pipelines and owners; run the OpenSSF Scorecard checks (Branch-Protection, Code-Review, Token-Permissions, Pinned-Dependencies, Dangerous-Workflow, SAST, Signed-Releases, SBOM) or equivalent across repositories to get a measured starting point; map current checks to SSDF practices.
  2. Quick wins (weeks 4 to 8): enable secret scanning with push protection, a dependency update tool and SCA on all repositories in report-only mode; revoke and replace every live secret found.
  3. Templates (months 2 to 4): publish a reusable pipeline template with SAST, SCA, IaC and image scanning, SBOM generation and signing; migrate a pilot ring of three to five willing teams first.
  4. Tune in audit mode: run each new rule non-blocking for two to four weeks, measure false positives with the pilot teams, disable or rewrite noisy rules, then switch the precise ones to blocking for new code only.
  5. Enforce at deployment (months 4 to 6): require signature and provenance verification at admission for production, starting in warn mode, then enforce per environment.
  6. Add depth (months 6 to 12): authenticated DAST for internet-facing services, fuzzing for parsers, SLSA Build L3 for distributed software, and a vulnerability disclosure process feeding RV.1.
  7. Rollback plan: every gate is controlled by a versioned policy flag in the shared template, so a broken rule can be returned to warn mode across all pipelines in one change, with the change itself reviewed and logged. Never roll back by letting teams delete the step from their own pipelines.

Detection and measurement

Log and monitor the pipeline as a production system:

  • Events to log: gate overrides and who approved them, changes to workflow and gate policy files, changes to branch protection, failed signature or provenance verification at deployment, new tokens created for pipeline identities, and secret scanner alerts with their revocation status.
  • Coverage checks: repositories without the standard template, production artefacts without an SBOM or signature, and services without an owner in the findings platform.
MetricWhat it showsHealthy direction
Mean time to remediate critical and high findings, by teamWhether findings are acted onFalling and within SLA
Escaped vulnerabilities (found in production or by external report) per releaseWhether early checks workFalling
Gate override rate and expired exceptionsWhether gates are trusted or bypassedLow and stable; zero expired
Template coverage: share of repositories and production deployments using the standard pipelineReach of the programmeRising towards 100%
Share of production artefacts with verified signature, provenance and SBOMRelease integrityRising towards 100%
Time from secret detection to revocationWhether leaked credentials are actually neutralisedHours, not days

Report these next to delivery measures such as deployment frequency and change failure rate, so improvements in security are not bought with slower delivery unnoticed. See the Board Cyber Risk Reporting Guide for executive reporting.

Framework mapping

DevSecOps capabilityNIST SSDF 1.1NIST SP 800-53 Rev. 5NIST CSF 2.0OWASP SAMM
Security requirements and threat modellingPO.1, PW.1, PW.2SA-8, SA-15PR.PS-06Threat Assessment, Security Requirements
Toolchain and secure environmentsPO.3, PO.5SA-15, CM-2PR.PS-01Secure Build
Code review and static analysisPW.5, PW.7SA-11PR.PS-06Security Testing
Dynamic testing and fuzzingPW.8SA-11ID.IM-02Requirements-driven Testing, Security Testing
Third-party components and SBOMPW.4, PS.3SR-3, SR-4, SA-4GV.SC-05, ID.AM-02Secure Build
Source protection and change controlPS.1SA-10, CM-3PR.PS-01Secure Build
Signing and release integrityPS.2CM-14, SI-7, SI-7(15)PR.PS-06Secure Deployment
Vulnerability responseRV.1, RV.2, RV.3RA-5, SI-2ID.RA-01Defect Management

Relevant ATT&CK techniques for threat-informed testing of the pipeline include T1195.002 Compromise Software Supply Chain, T1552.001 Credentials In Files and T1528 Steal Application Access Token. CIS Controls v8.1 Control 16 (Application Software Security) covers the same ground at safeguard level. NIST published an initial public draft of SSDF version 1.2 (SP 800-218 Rev. 1) in December 2025; check the NIST CSRC page for its current status before mapping to the new version. See the NIST Secure Software Development Framework (SSDF, SP 800-218) Guide.

Common failure patterns

  • Every scanner switched on, blocking, on day one: thousands of legacy findings block merges, teams get blanket exceptions, and the gates are never trusted again. Start with new code and report-only.
  • Secrets found but not revoked: deleting the line or the image leaves the credential valid in history and copies. Detection without revocation is the most common gap; measure time to revocation.
  • Mutable references to third-party code: referencing actions, images or packages by tag let the tj-actions and KICS attackers reach downstream pipelines by moving a tag. Pin by SHA or digest and let a dependency bot update the pins.
  • Signing without verification: artefacts are signed in the build but nothing checks signatures at deployment, so a substituted artefact deploys anyway.
  • Security tools with unlimited access: scanners and bots run with organisation-wide admin tokens because it was easier to set up. They become the highest-value target in the pipeline.
  • Findings with no owner: results land in a central dashboard that no delivery team reads. Route each finding to the team that owns the service, in the tool they already use.

Practitioner checklist

  • Map every existing pipeline check to an SSDF practice and list the practices with no check.
  • Write and version a gate policy per stage, with block criteria, ticket criteria and an exceptions process with expiry dates.
  • Enable secret scanning with push protection on all repositories and track time from detection to revocation.
  • Publish a reusable pipeline template with SAST, SCA, IaC and image scanning, SBOM generation and signing, and measure template coverage.
  • Run new rules in audit mode with a pilot ring before blocking, and keep a one-change rollback to warn mode.
  • Protect workflow and gate policy files with code owner review and branch protection.
  • Reach SLSA Build L2 for production artefacts and verify signatures and provenance at deployment.
  • Pin third-party actions and images by commit SHA or digest and keep pins updated automatically.
  • Give every scanner, bot and release identity an owner, least-privilege scope and short-lived credentials.
  • Report remediation time, escaped vulnerabilities, override rate and release integrity coverage monthly.

Standards and references

Related NHI Mgmt Group resources: Application Security Guide · Secure Coding Guide · Open Source Security Guide · CI/CD Pipeline Compromise Playbook · Top 10 Supply Chain Attacks

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Written and reviewed by Lalit Choda, NHI Mgmt Group. Last updated 24 October 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.