Security teams should issue short-lived, workload-bound credentials at runtime instead of reusing hard-coded keys or tokens. That approach reduces secret sprawl, limits the blast radius of compromise, and makes access easier to audit. The practical goal is to tie each job or service to a specific identity, then renew credentials automatically as work continues.
Why This Matters for Security Teams
Static credentials in CI/CD pipelines and service accounts create a hidden trust problem: once a key, token, or certificate is embedded, it can be copied, replayed, and reused long after the original job has finished. That turns routine automation into persistent access. Security teams increasingly treat this as an NHI governance issue because the identity bound to the workload, not the secret itself, is what should define access.
This is exactly why guidance from OWASP Non-Human Identity Top 10 and NIST SP 800-53 Rev 5 Security and Privacy Controls keeps converging on least privilege, credential lifecycle control, and stronger authentication for machine actors. NHIMG research on Guide to the Secret Sprawl Challenge shows how quickly exposed secrets become an operational problem once they are distributed across repositories, build logs, and developer tooling. In practice, many security teams discover the issue only after a pipeline secret has already been copied into a log, artifact, or compromised build step, rather than through intentional review.
How It Works in Practice
The replacement pattern is to issue short-lived, workload-bound credentials at runtime, then revoke or let them expire automatically when the task ends. For CI/CD, that usually means the pipeline runner authenticates using a workload identity, receives a temporary token, and exchanges it for scoped access only to the target resource. For service accounts, the same principle applies: the service proves what it is, then receives access just for the request or session window.
Current best practice is to separate identity from secret storage. Instead of checking a long-lived token into a repo or injecting it as a static environment variable, teams bind access to the runtime context using mechanisms such as OIDC federation, SPIFFE/SPIRE workload identity, or a secrets broker that mints ephemeral credentials on demand. That reduces secret sprawl and improves auditability because each credential can be tied to one job, one service, or one environment transition.
Operationally, teams should define:
- What workload identity proves the caller is a trusted build, job, or service
- Which resources the workload may access, and for how long
- How credentials are rotated, revoked, and logged automatically
- How break-glass access is handled when federation or issuance fails
NHIMG’s Ultimate Guide to NHIs — Static vs Dynamic Secrets is useful here because it frames the practical shift from stored secrets to dynamic credentials. For implementation detail, the NIST SP 800-63 Digital Identity Guidelines are most relevant when the federation flow includes an authenticating human or issuer, while machine-to-machine trust should be grounded in workload identity and policy enforcement at request time. These controls tend to break down in legacy batch systems and vendor-managed runners because the environment cannot reliably prove workload identity or refresh credentials without manual intervention.
Common Variations and Edge Cases
Tighter credential control often increases deployment complexity, so organisations have to balance reduced blast radius against pipeline fragility and operational overhead. That tradeoff is especially visible in hybrid estates, third-party build systems, and service meshes that mix modern identity federation with older static-account dependencies.
There is no universal standard for every environment yet, but current guidance suggests three practical exceptions:
- Legacy jobs that cannot federate should be isolated, time-boxed, and monitored more aggressively than modern workloads
- Long-running services may need credential renewal mid-session, so expiry must align with application behaviour rather than arbitrary calendar intervals
- High-frequency pipelines may need cached ephemeral tokens with very short TTLs to avoid excessive authentication churn
Security teams should also watch for hidden secret reintroduction through container images, artifact stores, and build-time environment variables. NHIMG’s CI/CD pipeline exploitation case study is a reminder that a secure design can still fail if secrets are leaked into logs or reused across stages. For teams formalising the control set, the Reviewdog GitHub Action supply chain attack shows why ephemeral credentials and scoped trust are safer than standing access in automation. Best practice is evolving, but the direction is clear: reduce standing secrets, bind access to workload identity, and make every credential temporary by 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, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Directly addresses replacing static machine credentials with ephemeral NHI trust. |
| OWASP Agentic AI Top 10 | A-03 | Automated jobs behave like autonomous agents when they can chain tool access. |
| CSA MAESTRO | ID-01 | Covers workload identity and trust for autonomous cloud workloads and agents. |
| NIST AI RMF | Supports governance of dynamic, context-aware authorization for automated systems. | |
| NIST Zero Trust (SP 800-207) | AC-4 | Zero trust requires continuous verification, not reliance on static pipeline trust. |
Inventory each pipeline and service identity, then eliminate standing secrets in favor of short-lived issuance.
Related resources from NHI Mgmt Group
- How should security teams replace static allowlists in CI/CD pipelines with safer trust controls?
- How should security teams govern credentials used by CI/CD pipelines?
- How should security teams eliminate static secrets from CI/CD pipelines?
- How should security teams replace a sunset container builder without disrupting CI/CD pipelines?