Standing service accounts and persistent tokens increase the chance of lateral movement, accidental reuse, and privilege creep when a pipeline or runner is compromised. In CI/CD, those credentials often outlive the job that needed them, so a single exposure can affect multiple projects or stages. Short-lived issuance and automatic revocation reduce that exposure window.
Why This Matters for Security Teams
Standing service accounts and personal access tokens are risky in CI/CD because they turn a job-scoped operation into an enduring trust relationship. Once a runner, build container, or developer workstation is compromised, the attacker often inherits credentials that were never meant to survive past the pipeline stage. That is exactly the kind of exposure pattern highlighted in the Guide to the Secret Sprawl Challenge, where secrets routinely outlive their intended use and spread across tools, repos, and tickets.
The core issue is not only theft, but reuse. Persistent credentials can be copied into scripts, cached in config files, or shared across multiple services because they are convenient under delivery pressure. In a CI/CD environment, that convenience becomes blast radius: one token can unlock artifact stores, deployment targets, source control, and cloud APIs. Current guidance from the OWASP Non-Human Identity Top 10 and NIST Cybersecurity Framework 2.0 both points toward least privilege and lifecycle control, but the failure mode is usually operational: the token remains valid long after the job is gone. In practice, many security teams only discover this after a pipeline compromise has already been used to pivot into multiple environments.
How It Works in Practice
CI/CD systems work best when identity is tied to the workload, not the person or service name. That means replacing standing credentials with short-lived issuance, runtime checks, and automatic revocation as soon as the job ends. For human operators, that may look like just-in-time access; for pipelines, it should look like workload identity with cryptographic proof of what is running, where it is running, and what it is allowed to do. The design goal is to make access ephemeral by default, not persistent by convenience.
In practical terms, teams should prefer federated authentication, OIDC-issued tokens, and scoped workload identities over long-lived personal access tokens. Where possible, each build or deployment stage should request credentials only for the exact target it needs, with TTLs measured in minutes rather than days. Policy decisions should be evaluated at request time, not baked into a static role that outlives the pipeline. That is consistent with the direction described by CI/CD pipeline exploitation case study and the Reviewdog GitHub Action supply chain attack, where automation trust was broader than the actual task required.
- Bind credentials to a single job, stage, or runner instance.
- Use short TTLs and revoke on completion, cancellation, or failure.
- Scope tokens to one repository, one environment, or one API action.
- Log issuance, use, and revocation as separate events for auditability.
- Block reuse across projects unless a formal exception exists.
These controls tend to break down when shared runners, inherited environment variables, or manually triggered release jobs rely on the same credential across multiple stages because the identity boundary becomes ambiguous.
Common Variations and Edge Cases
Tighter credential controls often increase release friction, requiring organisations to balance deployment speed against revocation discipline. That tradeoff is real, especially where legacy tooling cannot federate cleanly or where third-party integrations only support personal access tokens. Current guidance suggests treating those exceptions as temporary, not as a default operating model.
Some environments also mix human and machine use of the same service account, which makes attribution and containment much harder. That pattern should be considered a risk amplifier rather than a compromise mitigation. The same is true for emergency break-glass tokens: they may be necessary, but they should be isolated, heavily monitored, and rotated after use. NHI research from The 2025 State of NHIs and Secrets in Cybersecurity shows how often tokens remain active far beyond their intended lifecycle, while breach reporting such as the Salesloft OAuth token breach shows how persistent tokens can become an access path long after the original event.
There is no universal standard for this yet, but the safest pattern is clear: separate identities per workload, eliminate standing secrets wherever possible, and reserve persistent access only for narrowly justified exceptions with documented expiry.
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, OWASP Agentic AI Top 10 and CSA MAESTRO 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 | Persistent tokens create lifecycle risk when rotation and revocation are weak. |
| OWASP Agentic AI Top 10 | A-03 | Static credentials in automated workloads enable unsafe autonomous privilege reuse. |
| CSA MAESTRO | IDM-02 | MAESTRO covers identity and access for autonomous workloads and pipelines. |
| NIST AI RMF | AI RMF supports governance for dynamic, autonomous systems using secrets. | |
| NIST CSF 2.0 | PR.AC-1 | Identity proofing and access control are central to limiting standing credential abuse. |
Issue ephemeral workload identities for each CI/CD step and revoke them immediately after use.
Related resources from NHI Mgmt Group
- Why do privileged service accounts and domain controller access create such high risk in Active Directory?
- Why do service accounts and API tokens create more risk when they are long-lived?
- Why do service accounts and secrets with standing access increase risk in cloud environments?
- Why do service accounts and access tokens create more breach risk than human accounts?