Subscribe to the Non-Human & AI Identity Journal

Why do CI/CD tokens increase supply chain risk when they are over-scoped?

Because they behave like machine identities with real authority. If the same token can build, access secrets, and publish artifacts, one compromised dependency can turn a single installation into lateral movement across release and deployment paths. Narrow scoping, per-job issuance, and explicit separation of duties reduce that blast radius substantially.

Why This Matters for Security Teams

CI/CD tokens are not just convenience credentials. In modern pipelines they often act as non-human identities with the ability to read repositories, invoke build systems, fetch secrets, and push artifacts. When those privileges are bundled into one long-lived token, a compromise in any upstream dependency, runner, or maintainer account can become a supply chain event rather than a single-job failure. The OWASP Non-Human Identity Top 10 highlights why machine credentials need the same discipline as human access: visibility, lifecycle control, and least privilege.

The practical risk is not abstract. Over-scoped tokens often outlive the job that issued them, are reused across environments, and accumulate permissions because pipeline owners want fewer build breaks. That creates a trust chain where a compromise in code, a package install step, or a misconfigured runner can be converted into artifact tampering, secret exposure, or unauthorized deployment. Security teams usually discover the weakness only after an attacker has used the token path to move from a build system into release or production access, rather than through intentional access design.

How It Works in Practice

In a healthy pipeline, a token should be issued for a single purpose, valid only for the shortest time needed, and scoped to the exact repository, environment, and action required. That usually means a job token for build actions, a separate deployment credential for release steps, and a distinct secret retrieval path for protected data. The key control objective is to make it impossible for one credential to cross those boundaries casually.

Over-scoping becomes dangerous when token permissions collapse multiple trust zones into one identity. For example, a token with both package publish and secret read permissions can let an attacker inject malicious code, retrieve signing material, and publish a trusted-looking artifact in the same workflow. A token that can trigger deployments and modify infrastructure definitions can turn a CI compromise into environment-wide impact. The threat pattern aligns with supply chain compromise concerns described in the NIST Cybersecurity Framework 2.0, especially around asset governance, access control, and recovery.

Operationally, strong teams usually apply three measures together:

  • Per-job or per-stage token issuance instead of shared pipeline credentials.
  • Explicit separation between build, test, signing, publish, and deploy privileges.
  • Short expiration, auditable issuance, and automatic revocation after use.

Those controls should be backed by secret scanning, pipeline policy checks, and monitoring for anomalous token use across runners and environments. Where artifact signing or provenance is involved, the token that builds software should not also be able to approve or release it. Current guidance suggests that identity boundaries inside CI/CD matter as much as network boundaries, because the attacker only needs one reusable credential to traverse the pipeline graph. These controls tend to break down when self-hosted runners share persistent state and administrators rely on a single all-purpose token to keep releases moving.

Common Variations and Edge Cases

Tighter token scoping often increases operational overhead, requiring organisations to balance release speed against stronger segregation of duties. That tradeoff is real, especially in smaller engineering teams where pipeline simplicity has historically won over control depth. Best practice is evolving, but the direction is clear: access should be as narrow as the job allows, not as broad as the platform permits.

Some environments need broader access temporarily, such as release cutovers, emergency patches, or legacy toolchains that cannot yet support fine-grained tokens. In those cases, time-bound elevation is preferable to standing privilege, and the elevated path should be separately logged and reviewed. Another edge case is third-party CI integration, where external services may require repository or artifact access that is difficult to segment cleanly. That does not justify permanent broad scope; it means the integration should be isolated, monitored, and periodically revalidated against current necessity.

There is no universal standard for how many pipeline identities are ideal, but the rule is consistent: one token should not be able to build, read secrets, sign artifacts, and deploy everywhere. The closer a token gets to production authority, the more it should be treated like a high-value machine credential with explicit lifecycle management. In practice, over-scoped CI/CD tokens are usually exposed only after a dependency compromise, not during ordinary development hygiene.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-2 CI/CD tokens are machine identities that need lifecycle and scope control.
NIST CSF 2.0 PR.AC-4 Least-privilege access is central to limiting token blast radius in pipelines.

Inventory pipeline tokens, assign owners, and remove any credential that can operate beyond its intended job.