Subscribe to the Non-Human & AI Identity Journal

What fails when static credentials are used in CI/CD pipelines?

Static credentials fail because they remain reusable during execution, so any compromise of a runner, workflow, or dependency can expose secrets that unlock other systems. In practice, one leaked token can cascade into package registries, container repos, and production environments. The control failure is not only exposure, but the lack of a narrow runtime boundary for reuse.

Why This Matters for Security Teams

Static credentials in CI/CD pipelines are not just a secret-handling problem. They create a reusable identity boundary that outlives the job, the runner, and sometimes the repository itself. Once a token is embedded in build steps, any compromise of the pipeline can turn into access across registries, cloud services, and deployment targets. That is why current guidance favors short-lived, task-scoped credentials and workload identity over standing secrets, as reflected in the OWASP Non-Human Identity Top 10 and NHIMG’s Guide to the Secret Sprawl Challenge.

The operational risk is broader than disclosure. A leaked CI token often has enough scope to sign artifacts, publish packages, or pull infrastructure state, which means a single workflow compromise can become a supply chain event. NHIMG’s research shows how quickly exposed credentials are abused in practice, and secrets in automation remain a preferred target because they are both high-value and widely reused. In practice, many security teams encounter the blast radius only after a runner or dependency is already trusted by several downstream systems.

How It Works in Practice

The practical failure is that static credentials do not match how CI/CD actually behaves. Pipelines are ephemeral, parallel, and frequently triggered by untrusted inputs such as pull requests, build plugins, or third-party actions. If the same API key or cloud access token is mounted into every run, then any single compromise can reuse that identity outside the narrow job context. Best practice is evolving toward just-in-time issuance, workload identity, and policy evaluated at request time rather than pre-baked secrets.

For most teams, that means replacing long-lived tokens with federated identity flows, OIDC-based exchanges, or brokered short-lived credentials that expire when the job ends. The goal is to prove what the runner is, what it is allowed to do right now, and for how long. This is consistent with the operational direction in the CI/CD pipeline exploitation case study and the Ultimate Guide to NHIs — Static vs Dynamic Secrets.

  • Use per-job credentials with a tight TTL, not shared service accounts.
  • Bind identity to the runner, repository, environment, and workflow event.
  • Scope access to one action, such as publish, deploy, or sign, rather than broad platform rights.
  • Revoke or invalidate credentials automatically when the job completes or fails.
  • Log token issuance and use so anomalous reuse can be detected quickly.

This aligns well with NIST identity guidance and the expectation that access should be specific, auditable, and limited to the transaction being performed. These controls tend to break down when legacy build tooling cannot federate identity and still requires hardcoded secrets in environment variables or plaintext configuration.

Common Variations and Edge Cases

Tighter credential controls often increase pipeline complexity, requiring organisations to balance deployment speed against governance and integration overhead. That tradeoff is real in monorepos, hybrid clouds, and older runners that cannot support OIDC federation or scoped workload identity. In those environments, teams sometimes keep static credentials temporarily, but current guidance suggests isolating them to the smallest possible blast radius and rotating them aggressively.

There is no universal standard for every CI/CD design yet, especially where build systems span multiple providers or where third-party actions need delegated access. Some teams can shift entirely to ephemeral credentials; others need an interim broker that issues short-lived tokens only after policy checks pass. The key is to treat credentials as execution artifacts, not persistent configuration. NHIMG’s Reviewdog GitHub Action supply chain attack is a reminder that automation trust often fails at the integration boundary, not just the secret store. When builds depend on long-lived keys for release signing, package publishing, or cross-account cloud access, static credentials remain a high-risk exception rather than an acceptable default.

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 AI RMF and 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-03 Static CI/CD secrets violate short-lived NHI credential principles.
NIST AI RMF GOVERN CI/CD credential use needs accountable governance and lifecycle ownership.
NIST CSF 2.0 PR.AC-4 Least-privilege access is directly undermined by static pipeline credentials.

Replace reusable pipeline secrets with ephemeral, task-scoped credentials and rotate anything long-lived.