Secure DevOps Pipeline Pattern
Click any control badge to view its details. Download SVG
Key Control Areas
Pipeline Infrastructure Security
Source Code & Repository Governance
Secrets & Credential Management
Software Supply Chain Integrity
Automated Security Testing
Artifact Integrity & Provenance
Deployment Security & Environment Promotion
Infrastructure as Code Governance
Audit, Evidence & Compliance Automation
Application Authentication and Authorisation Baseline
Input Validation and Output Encoding
Structured Application Logging
API Security Hardening
When to Use
Organisation develops and deploys software through CI/CD pipelines. Multiple teams contribute to shared codebases with automated build and test processes. Software is deployed to cloud infrastructure, containers, or managed platforms. Organisation has compliance obligations requiring evidence of secure development and deployment practices (SOC 2, ISO 27001, PCI DSS, FedRAMP). Software supply chain security is a board-level concern or regulatory requirement. Organisation consumes significant open source dependencies. Infrastructure is managed as code (Terraform, CloudFormation, Kubernetes). Organisation is adopting or expanding DevOps practices and wants to integrate security without compromising delivery velocity.
When NOT to Use
Organisation develops no software and operates no CI/CD pipelines. All software is procured as managed SaaS services with no custom development, build, or deployment activities. Note: this contra-indication is narrowing -- even organisations that primarily consume SaaS increasingly maintain custom integrations, scripts, and infrastructure-as-code that benefit from pipeline security practices.
Typical Challenges
Balancing pipeline speed with security thoroughness is the central tension in DevSecOps: comprehensive security scanning adds latency that frustrates developers under delivery pressure, leading to pressure to weaken or bypass security gates. False positive management in automated security tools erodes developer trust -- when tools consistently flag non-issues, teams learn to ignore findings, including genuine vulnerabilities. Secrets sprawl across multiple systems (CI platform, cloud providers, container orchestrators, application configuration) makes comprehensive secrets management difficult. Dependency management at scale is operationally challenging: a single critical vulnerability in a widely-used library may affect hundreds of services simultaneously. Legacy pipeline migration is complex -- retrofitting security into existing pipelines risks breaking delivery flows and requires careful phasing. Pipeline-as-code introduces its own security risks: misconfigured workflows, excessive permissions in pipeline tokens, and insufficient isolation between pipeline stages. Developer experience must be prioritised: if security tools are difficult to use, produce noisy output, or lack clear remediation guidance, adoption will be superficial. Multi-cloud and hybrid environments create pipeline complexity with inconsistent tooling and security models across providers.
Threat Resistance
Supply chain attacks via compromised dependencies, malicious packages, and typosquatting targeting package registries. Pipeline poisoning through malicious modification of build configuration, injection of unauthorised build steps, or compromise of build infrastructure. Secret exposure through hardcoded credentials in source code, build logs, container images, or error messages. Artifact tampering between build and deployment, including man-in-the-middle attacks on artifact registries and unsigned deployment packages. Privilege escalation through overly permissive CI/CD service accounts and pipeline tokens with excessive scope. Unauthorised code injection via merge request manipulation, insufficient branch protection, or compromise of developer accounts. Infrastructure drift attacks where manual changes introduce vulnerabilities that bypass IaC governance. Container supply chain compromise through base image manipulation, malicious layers, or registry poisoning. Insider threats leveraging pipeline access to inject backdoors or exfiltrate sensitive data. Compliance evidence manipulation through falsified pipeline results or tampered audit logs. Dependency confusion and typosquatting attacks targeting private package namespaces. Deployment to production without security gate verification due to pipeline misconfiguration or deliberate bypass.
Assumptions
Organisations use automated CI/CD pipelines to build, test, and deploy software. Pipelines run on cloud-hosted or self-hosted infrastructure with access to source code repositories, artifact registries, secrets stores, and deployment targets. Development teams practice continuous integration with multiple daily commits merged to shared branches. Deployment targets range from cloud infrastructure (containers, serverless, VMs) to on-premises environments. Some organisations use managed CI/CD services (GitHub Actions, GitLab CI, Azure DevOps) while others operate self-hosted platforms (Jenkins, TeamCity, custom). The threat landscape for software supply chains is intensifying rapidly, with nation-state actors and criminal groups specifically targeting build systems and distribution channels. Pipeline security controls should be proportionate to the value and exposure of the software being delivered -- internal tools may accept lower assurance levels than customer-facing services or safety-critical systems.
Developing Areas
- AI-generated code security review is an urgent and largely unsolved challenge as AI coding assistants become standard developer tools. Code generated by LLMs may contain subtle security vulnerabilities, use deprecated APIs, or introduce insecure patterns that look syntactically correct but violate security properties. Traditional SAST tools catch some of these issues, but AI-generated code can exhibit novel vulnerability patterns that are not in existing rule databases. The emerging discipline of AI code review -- where AI reviews AI-generated code -- creates recursive trust problems that the industry has not resolved.
- SLSA provenance adoption beyond Level 1 remains limited despite growing ecosystem support. SLSA Level 1 (documented build process) is achievable with standard CI/CD platforms, but Levels 2-4 (hermetic builds, verified provenance, reproducible builds) require significant infrastructure investment and workflow changes. Most open-source projects and enterprise pipelines operate at Level 1 at best, and the tooling for generating, storing, and verifying SLSA provenance attestations across heterogeneous build systems is still maturing. Sigstore adoption is helping, but integration with enterprise change management and compliance workflows remains incomplete.
- Ephemeral build environment security is improving but introduces its own attack surface. While ephemeral runners eliminate persistence of compromised state, they create supply chain risks around the build environment images themselves -- a poisoned base image used by ephemeral runners compromises every build that uses it. The attestation chain from build environment image, through runner provisioning, to artifact production is a nascent area where solutions like GitHub's verified build environments and Google Cloud Build's provenance attestation are establishing patterns, but standardisation across CI/CD platforms does not exist.
- Pipeline-as-target attacks are increasing in sophistication as adversaries recognise that compromising a CI/CD pipeline provides a scalable supply chain attack vector. The attacks on SolarWinds, Codecov, and GitHub Actions third-party actions demonstrated that build systems are high-value targets, yet most pipeline security assessments focus on the artifacts produced rather than the pipeline infrastructure itself. Emerging practices include treating pipeline configuration as security-critical code, applying the principle of least privilege to pipeline service accounts, and deploying runtime security monitoring within build environments -- but these practices are adopted by fewer than 10% of organisations with mature DevOps programmes.
- Software attestation ecosystem maturity is progressing through initiatives like Sigstore, in-toto, and the OpenSSF's GUAC project, but the end-to-end verification story remains fragmented. Generating attestations at build time is increasingly straightforward, yet verifying them at deployment time across heterogeneous environments -- Kubernetes clusters, serverless platforms, VM-based deployments -- requires tooling that is still in early stages. The vision of a continuous chain of trust from source code through build to runtime, where every component can prove its provenance, is technically feasible but operationally distant for most organisations.
- Software composition analysis (SCA) accuracy is improving but still generates significant noise. The core challenge is determining whether a vulnerable dependency is actually reachable in the application's execution path -- a library may contain a vulnerable function that the application never calls. Reachability analysis is an emerging SCA capability that reduces false positives by 40-60% in early implementations, but it requires deep language-specific analysis that not all SCA tools support across all ecosystems.
- Interactive Application Security Testing (IAST) adoption is growing as a middle ground between SAST (high false positives, no runtime context) and DAST (limited code coverage, slow feedback). IAST instruments the running application to observe data flow and detect vulnerabilities with runtime context, producing fewer false positives than SAST. However, IAST requires instrumentation agents that may not support all language runtimes, and coverage depends on test suite quality. The tool category is approximately 5 years behind SAST/DAST in ecosystem maturity.
Related Patterns
Patterns that operate within or alongside this one. Click any to view.