CI/CD Security
CI/CD security protects the automated pipelines that build, test and deploy software, so attackers can't steal their secrets or slip malicious code into releases. A compromised pipeline can push malware to every customer.
Also called: CI/CD pipeline security, continuous integration security, continuous delivery security, DevSecOps, build pipeline security
What is CI/CD?
Continuous integration and continuous delivery (CI/CD) is how most software teams ship code today. When a developer saves changes to the code repository, an automated pipeline, using tools like GitHub Actions, GitLab CI, Jenkins or Azure DevOps, builds the software, runs tests and deploys it, sometimes straight to production.
Why pipelines are a target
A CI/CD pipeline has the keys to everything: access to source code, cloud accounts, package registries, signing keys and production servers. Compromising it lets an attacker:
- Steal secrets, such as cloud keys and tokens, stored in the pipeline
- Inject malicious code into a legitimate release, which then reaches every customer as a trusted update. The SolarWinds attack disclosed in 2020 worked this way, inserting a backdoor during the build.
- Deploy directly to production, bypassing code review
NIST's guide, SP 800-204D, treats the pipeline as a core part of the software supply chain that needs its own protections.
Common risks
OWASP's Top 10 CI/CD Security Risks include:
- Insufficient flow control: code can reach production without review
- Inadequate identity and access management: too many people or tools with broad pipeline access
- Dependency chain abuse: malicious or confused packages pulled into builds
- Poisoned pipeline execution: attackers changing pipeline configuration through a pull request
- Inadequate credential hygiene: secrets in code, logs or long-lived tokens
- Insecure system configuration and ungoverned use of third-party services, such as unvetted plugins and actions
How to secure a pipeline
- Require code review and protected branches for anything that reaches production.
- Apply least privilege to pipeline identities and use short-lived credentials instead of stored keys.
- Store secrets in a vault (secrets management) and keep them out of logs.
- Pin and vet third-party actions and plugins.
- Scan in the pipeline: SAST, dependency scanning, secret scanning and container image scanning.
- Sign build outputs (code signing) and generate an SBOM.
- Isolate build environments and log pipeline activity.
If you buy software, ask vendors how they protect their build pipelines as part of third-party risk management.
Related terms
Sources
Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.
