CI/CD Pipeline Security

Secure your CI/CD pipeline with access control, secrets management, and automated checks to prevent attacks and unauthorized deployments.

Last Updated date: June 2026

CI/CD pipeline security is the practice of embedding security controls, access governance, secrets management, automated scanning, and integrity verification, directly into the software delivery pipeline. The goal is to prevent attackers from using the build and deployment process itself as an attack vector, rather than targeting the finished application.

A compromised pipeline does not need a zero-day. It ships your next release for you.


Quick Summary

Quick Summary
FieldDetail
CategoryDevSecOps / Application Security
Related toIAM, Secrets Management, Zero Trust, Supply Chain Security, IGA
Primary useSecuring the code → build → test → deploy path against injection, takeover, and credential theft
Key benefitPrevents attackers from weaponizing the release pipeline as an entry point

Why the Pipeline Is a Tier-0 Target

Most security programs treat pipelines as internal infrastructure that is trusted by default and only lightly monitored. That assumption does not hold up in practice.

A CI/CD pipeline has elevated access to source code, build environments, cloud credentials, production secrets, and deployment targets. If an attacker gains control of the pipeline, they effectively control everything downstream. At that point, no application-layer control can stop a malicious build artifact from reaching production.

The SolarWinds breach is a well-known example. Attackers did not target the product itself. Instead, they compromised the build system and inserted malicious code into a signed and legitimate software update that was later distributed to 18,000 customers.

This is why pipeline security cannot be treated as just a DevOps responsibility. It is fundamentally an identity and access governance problem.


Where Pipelines Get Compromised: Stage by Stage

Source Stage (Git repositories)
This stage is often exposed through credentials committed to code, malicious pull requests from compromised developer accounts, and weak or missing branch protection rules. Git history can retain secrets even after deletion, which attackers actively exploit.

Build Stage (CI runners and agents)
Compromised runners can execute attacker-controlled code. Dependency poisoning, where malicious packages are injected into npm, pip, or Maven registries, is a common attack path here. Shared, persistent runners introduce significantly higher risk compared to ephemeral runners.

Artifact and Registry Stage
If an artifact is compromised before signing, every deployment propagates that compromise. Unsigned artifacts without integrity checks make it easier for attackers to maintain persistence.

Deployment Stage
Overprivileged service accounts, long-lived cloud credentials, and poor environment separation allow attackers to move laterally from the pipeline into production systems.


Core Security Controls for CI/CD Pipelines

1. Identity and Access Governance

Pipeline identities such as CI service accounts, runner credentials, and deployment tokens are non-human identities. They should be governed with the same rigor as privileged human accounts.

This means enforcing least privilege, using time-limited tokens, separating identities across stages, and conducting regular access reviews.

Where possible, replace static secrets with short-lived OIDC tokens. Credentials stored in environment variables are a common and preventable source of leaks.

2. Secrets Management

Secrets should never be stored in source code, pipeline configurations, or build logs. Instead, use dedicated vaults such as HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault.

Rotate secrets frequently and audit access consistently.

For detection, tools like git-secrets and truffleHog can identify accidentally committed credentials. These scans should run at commit time, not after an incident.

3. Automated Security Testing (Shift Left)

Security checks are most effective when introduced early, ideally before code is merged rather than after deployment.

  • SAST (Static Application Security Testing) scans source code for vulnerabilities before execution
  • DAST (Dynamic Application Security Testing) tests running applications for exploitable weaknesses
  • SCA / Dependency Scanning identifies known vulnerabilities in open-source libraries
  • Container Scanning validates container images against vulnerability databases

Quality gates enforce these checks automatically and block deployments when security criteria are not met.

4. Supply Chain and Dependency Integrity

Always pin dependency versions instead of using "latest." Verify package signatures using tools like Sigstore or cosign.

Software Composition Analysis helps continuously monitor open-source components in your build.

The SLSA framework provides a structured maturity model for supply chain integrity, ranging from basic source control practices to fully verified and reproducible builds.

5. Pipeline Hardening

Reduce attack surface by tightening how your pipeline operates:

  • Use ephemeral runners that are created per job and destroyed afterward.
  • Restrict outbound network access from build environments.
  • Validate pipeline configuration files such as YAML or Jenkinsfile before execution, since workflow injection via malicious configuration is often overlooked.
  • Enforce signed commits and strong branch protection rules.

6. Monitoring and Anomaly Detection

Treat the pipeline as production infrastructure. Monitor it accordingly.

Set alerts for unusual triggers, unexpected dependency changes, permission escalations, suspicious outbound connections, and off-hours deployments.

Logging should be comprehensive, but logs must also be protected against tampering.


CI/CD Security and Identity Governance

Pipeline identities remain one of the most overprivileged and least governed identity categories in most enterprises.

CI/CD service accounts often have persistent access to source control, artifact registries, cloud environments, and secrets stores. In a human context, this level of access would require strict privileged access management controls, yet many organizations apply none.

Bringing these identities under an identity governance and administration framework involves:

  • Cataloging all service accounts and runner credentials
  • Assigning clear human ownership
  • Enforcing least-privilege access with periodic reviews
  • Applying just-in-time access for deployment credentials
  • Revoking access immediately when a developer leaves or a project is retired

This is not just an extension of IGA. It directly addresses one of the most exploited gaps in modern supply chain attacks.


Compliance Alignment

CI/CD security controls map directly to major frameworks:

ControlNIST CSFISO 27001SOC 2
Least privilege for pipeline identitiesPR.AC-4A.9.2CC6.3
Secrets managementPR.AC-1A.9.4CC6.1
Change management and signed commitsPR.IP-3A.12.1CC8.1
Vulnerability scanning in pipelineDE.CM-8A.12.6CC7.1
Supply chain integrityID.SC-4A.15.2CC9.2

For Indian enterprises, CERT-In's 2022 directive on mandatory incident reporting applies to breaches originating from compromised build infrastructure. DPDPA obligations extend to any pipeline processing personal data as part of build, test, or deployment workflows.

Identity Confluence governs the non-human identities your CI/CD pipeline depends on.

Frequently Asked Questions

It is the practice of embedding security controls such as access governance, secrets management, automated scanning, and integrity verification directly into the CI/CD pipeline to prevent the delivery process from becoming an attack vector.

Key risks include overprivileged service accounts, exposed or hardcoded secrets, compromised dependencies, unsigned artifacts, and shared persistent runners with broad access.

SAST analyzes source code before execution, while DAST tests a running application for exploitable issues. Both should operate as automated quality gates.

Each pipeline stage should operate with only the permissions it needs. Credentials should be short-lived, isolated per stage, and never shared across environments.

SLSA defines maturity levels for securing the software supply chain, helping organizations move toward verifiable and tamper-resistant builds.

Pipeline identities are non-human but highly privileged. They should be governed, reviewed, and controlled with the same rigor as human privileged accounts.

Related Terms

See how Identity Confluence brings identity governance to your pipeline service accounts and non-human identities.

Securing the application is necessary. Securing the system that builds and delivers it is non-negotiable. Even a fully hardened codebase cannot compensate for a compromised pipeline.