Shared deployment secrets turn a pipeline into a standing access path. If one credential leaks from logs, a developer laptop, or a compromised action, the attacker can reuse it until expiry and operate with the same privileges as the build job. That makes Kubernetes access a replayable identity problem, not a one-time secret exposure.
Why This Matters for Security Teams
Shared CI/CD secrets turn Kubernetes delivery into a reusable access path instead of a bounded deployment action. Once a pipeline secret is copied into logs, a runner cache, a developer workstation, or an action artifact, the same credential can be replayed until it expires or is revoked. That creates a standing identity problem for the cluster, not just a secret hygiene issue.
This is why NHI Management Group treats deployment secrets as workload identities, not convenience tokens. The operational risk is amplified by secrets sprawl and by the fact that many organisations still lack central control; Akeyless found 88% of security professionals are concerned about secrets sprawl, while only 44% of organisations use a dedicated secrets management system in its 2024 survey, published as The 2024 State of Secrets Management Survey. The OWASP Non-Human Identity Top 10 also frames this as an identity governance problem, not merely a storage problem, because non-human credentials should be scoped, rotated, and revoked like production access. In practice, many security teams encounter a compromised pipeline only after the same secret has already been reused across multiple clusters and namespaces.
How It Works in Practice
The safer pattern is to replace shared CI/CD secrets with short-lived, task-scoped credentials issued at runtime. Instead of storing a long-lived cluster token in a repository or runner image, the pipeline authenticates as a workload, receives an ephemeral token, performs one deployment, and then loses that access automatically. That shifts Kubernetes access from “who has the secret” to “what is this build trying to do right now.”
Implementation usually combines workload identity, just-in-time credential issuance, and policy evaluation at request time. The pipeline can present a cryptographic workload identity such as an OIDC token or SPIFFE-based identity, then exchange it for narrowly scoped access to the API server. Policy is evaluated with context such as branch, environment, target namespace, and approval state. Current guidance suggests this is more resilient than static RBAC alone because an agent or pipeline does not follow a fixed access pattern.
- Use ephemeral tokens for cluster access rather than reusable deployment secrets.
- Bind credentials to a specific job, environment, and TTL.
- Separate build, test, and release identities so compromise does not cross stages.
- Revoke credentials automatically when the pipeline ends or fails.
- Log issuance and use events so anomalous reuse is visible quickly.
For identity design and breach patterns, see the Guide to the Secret Sprawl Challenge and the Reviewdog GitHub Action supply chain attack. For standards alignment, OWASP Non-Human Identity Top 10 and the SPIFFE workload identity model both support short-lived, attested access rather than static secret reuse. These controls tend to break down when legacy release tooling can only authenticate with a shared kubeconfig because the system cannot express per-job identity or per-request authorization.
Common Variations and Edge Cases
Tighter credential control often increases delivery overhead, requiring organisations to balance release speed against stronger identity guarantees. That tradeoff is real in multi-cluster platforms, blue-green deployments, and external vendor runners where each environment may have different trust boundaries.
One common edge case is “temporary” shared access that quietly becomes permanent because a release freeze, rollback process, or manual hotfix needs a credential that was never designed for automation. Another is self-hosted runners, where the runner itself becomes the trust anchor; if that host is compromised, every secret it can mint or retrieve is exposed. There is no universal standard for this yet, but current guidance increasingly favors intent-based authorization at deployment time rather than broad namespace-level permissions.
For Kubernetes teams, the practical test is simple: if a leaked pipeline secret can deploy to production after the job has finished, the identity model is still static. The CI/CD pipeline exploitation case study and the Ultimate Guide to NHIs — Static vs Dynamic Secrets show why dynamic credentials are the safer default. The model breaks down most often in legacy GitOps and air-gapped environments where automation cannot fetch short-lived credentials and teams fall back to shared kubeconfigs.
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-01 | Addresses excessive trust in static non-human credentials used by CI/CD. |
| OWASP Agentic AI Top 10 | AGENT-03 | Deployment automation behaves like an autonomous workload with tool access. |
| CSA MAESTRO | ID-02 | Covers workload identity and lifecycle controls for automated cloud agents. |
| NIST AI RMF | GOVERN | Requires accountability and policy oversight for autonomous deployment behaviour. |
| NIST CSF 2.0 | PR.AC-1 | Least-privilege access control is directly implicated by shared CI/CD secrets. |
Replace shared deployment secrets with scoped, short-lived NHI identities for each pipeline job.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org