TL;DR: Static imagePullSecrets keep private image access alive until someone revokes them, while Cloudsmith's analysis shows that External Secrets and Kyverno can replace them with short-lived OIDC-backed credentials and admission-time image rewriting. The real control shift is from secret persistence to issuance-time governance, because a leaked pull credential should stop being a reusable access path.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Cloudsmith's blog post: Kubernetes image pulls can be governed with short-lived OIDC credentials, external secret distribution, and Kyverno admission rewriting instead of static imagePullSecrets.
Why it matters: That matters because image pull credentials are workload identities, and when they are long-lived the cluster inherits the same leakage and revocation problems seen in other NHI estates.
By the numbers:
- External Secrets replaces the credential every 50 minutes.
Context
Kubernetes image access is often governed with a static pull secret, which creates a durable credential that is easy to forget and hard to contain once exposed. In a cluster, that secret is effectively a workload identity, so the security question is not only whether the image repository is trusted but whether the credential lifecycle is controlled. This pattern is common in clusters that prioritise convenience over revocation discipline.
A short-lived alternative changes the control point from stored secret to token issuance. External Secrets Operator can mint a fresh credential from OIDC, and Kyverno can distribute and attach it at admission without changing application manifests. That shifts the problem from secret reuse to policy-enforced access at the point of pod creation.
Key questions
Q: How do I rotate Kubernetes image pull credentials safely?
A: Use short-lived tokens tied to workload identity, refresh them on a fixed schedule, and revoke the underlying access path rather than trying to manage a long-lived static secret. The goal is to make image pull access expire quickly enough that leakage has a limited blast radius and revocation is operationally simple.
Q: Why do static image pull secrets increase Kubernetes risk?
A: Static image pull secrets create standing access for registry authentication, so the same credential can be reused across many nodes, namespaces and deployments. If the secret is copied or exposed, an attacker can pull private images or abuse the registry token until it is rotated. Short-lived credentials, node-scoped access and separate registry identities reduce this exposure.
Q: What is the difference between admission control and image scanning?
A: Admission control decides whether a Kubernetes object is allowed into the cluster at create or update time, while image scanning inspects an image for vulnerabilities or policy issues before or after deployment. Admission control can block a pod that fails policy, but scanning alone does not stop runtime deployment. They are complementary controls, not substitutes.
Q: How should teams govern secrets copied into every namespace?
A: Govern namespace-wide secret distribution by minimising replication, using dedicated service accounts and mounting only the specific secret each workload needs. Copying the same secret into every namespace expands blast radius, complicates revocation and obscures ownership. Prefer central secret management, per-namespace scoping and rotation tied to workload lifecycle.
Technical breakdown
How OIDC token exchange replaces static registry secrets
The core mechanism is a trust exchange between the cluster and the image registry. A Kubernetes ServiceAccount JWT is presented to the registry through OIDC, and the registry issues a short-lived token in return. That token is not a long-term secret stored in manifests or copied manually between teams. Instead, the cluster proves identity at runtime, which narrows the exposure window and makes revocation a control-plane action rather than a repository clean-up exercise. Read the Ultimate Guide to NHIs: Static vs Dynamic Secrets.
Practical implication: Treat image-pull identity as an issued credential lifecycle, not a static secret distribution problem.
Why admission-time image rewriting matters for governance
Admission control lets the cluster rewrite image references before a Pod is accepted. That means developers can keep writing familiar upstream image names while policy redirects pulls through a governed repository and injects the right pull secret automatically. This is a material governance change because access is no longer dependent on every team knowing where to point every manifest. The control sits where the workload is created, which is where registry scope and namespace scope are actually enforced. See the Kubernetes Admission Control Guide.
Practical implication: Use admission policy to enforce registry routing and secret attachment centrally, rather than relying on manifest hygiene.
How external secret refresh narrows the revocation window
External Secrets Operator provides the rotation layer between identity proof and registry use. By refreshing the credential on a schedule and writing it into a Kubernetes Secret, it reduces the time an exposed token remains valid. The important detail is that the secret still exists, but it becomes ephemeral infrastructure state rather than a durable static credential. That distinction matters when the cluster spans multiple namespaces and the same image access must remain consistent without giving the secret a long life. See the Kubernetes Secrets Security Guide.
Practical implication: Set refresh intervals to keep pull credentials inside a tight, predictable expiry window.
Threat narrative
Attacker objective: The attacker wants persistent private image access through a reusable cluster credential that outlives any single pod or namespace.
- Entry begins when a cluster relies on a static imagePullSecret that can be copied or exposed through ordinary Kubernetes secret handling.
- Credential access follows when that pull secret is reused across namespaces and continues to authenticate image pulls until revocation.
- Impact occurs when the exposed credential lets an attacker pull private images or abuse registry access without changing application manifests.
Breaches seen in the wild
- Hugging Face Spaces breach 2024: Unauthorised access to Hugging Face Spaces may have exposed secrets users stored for AI apps; tokens were revoked and org tokens removed.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Static image pull secrets create hidden machine-identity persistence: the danger is not just leakage, but duration. A registry credential that survives across pods and namespaces behaves like standing privilege for workloads, which means revocation is the real governance event, not initial issuance. In NHI terms, the cluster is operating with a durable credential that should have been treated as ephemeral from the start. Practitioners should model image-pull access as a governed workload identity lifecycle, not as a one-time configuration choice.
Admission control moves registry trust into policy, which is where it belongs: Kyverno is doing more than rewriting image names. It becomes the enforcement point that decides whether a workload can reach an upstream registry, which image source is acceptable, and whether the right credential is attached. That makes the control auditable, repeatable, and much harder to drift out of scope. The architectural lesson is that image provenance and access scope should be bound together at admission, not separated across manifests and human memory.
Short-lived tokens reduce blast radius, but only if namespace distribution is tightly governed: copying a pull secret into every namespace solves convenience, but it also multiplies where the credential exists. The right governance model is not just shorter expiry. It is clear ownership of who can read the secret, where it is cloned, and which namespaces are excluded. That aligns with secret sprawl thinking because the problem is no longer whether the token exists, but how many places can act on it.
The named concept here is registry access at issuance time: access is decided when the credential is minted, not when the image is pulled. That is a more precise control model for Kubernetes than relying on long-lived registry secrets scattered across workloads. It pushes practitioners toward identity-bound access decisions that can be rotated, revoked, and audited in a single lifecycle. The practical conclusion is to design registry access around issuance, not storage.
From our research library:
- Red Hat’s Kubernetes Security Report found that nearly 9 in 10 organizations had at least 1 container or Kubernetes security incident in the last 12 months.
What this signals
Registry access at issuance time is the better control model: Kubernetes image pulls are easiest to govern when the credential is minted for a specific workload context and expires before it becomes reusable. That reduces the chance that one exposed token can follow a workload across namespaces or survive long enough to become a durable access path.
Admission policy is increasingly where identity and provenance meet in Kubernetes. When image rewriting and secret injection happen before the Pod is accepted, registry governance becomes enforceable instead of advisory, which is a cleaner model for large multi-team clusters.
For practitioners
- Implement short-lived registry credentials Replace static imagePullSecrets with OIDC-backed credentials that expire quickly and are refreshed on a predictable schedule. Read the Ultimate Guide to NHIs: Static vs Dynamic Secrets.
- Enforce admission-time image rewriting Use policy to rewrite upstream image references to a governed registry path before Pods are admitted. See the Kubernetes Admission Control Guide.
- Limit who can read cloned pull secrets Apply Kubernetes RBAC so only the controllers and operators that need the generated secret can access it. See the Kubernetes Secrets Security Guide.
- Separate repositories by upstream risk Avoid letting different upstream registries collapse into the same repository namespace when name collisions could change which image is served.
- Run redundancy around policy controllers Deploy multiple Kyverno replicas so admission does not become a single point of failure when Pod creation depends on policy enforcement.
Key takeaways
- Static registry credentials turn Kubernetes image pulls into a standing access problem rather than a short-lived authentication event.
- Admission-time rewriting and secret refresh together narrow the window in which a leaked pull credential can be abused.
- The strongest control is not the registry itself but the point where the cluster issues, distributes, and attaches image access.
Related NHI Mgmt Group resources: Ultimate Guide to NHIs: Static vs Dynamic Secrets · Kubernetes Admission Control Guide · Kubernetes Secrets Security Guide · Guide to the Secret Sprawl Challenge
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 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | The article centers on leaked or reused pull secrets as the main exposure path. |
| NHI-07 — Long-Lived Secrets | Static imagePullSecrets are the long-lived credential pattern the post is replacing. | |
| Recommendation — Scan for leaked registry credentials and revoke any exposed pull secret immediately. Replace static pull secrets with short-lived credentials and enforce scheduled rotation. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Registry tokens are authenticators whose lifecycle must be controlled and rotated. |
| Recommendation — Manage registry authenticators through rotation, revocation, and expiry enforcement. | ||
| CIS Controls v8 | CIS-5 — Account Management | The workflow depends on controlling the service account and generated secret lifecycle. |
| Recommendation — Inventory and remove unused service identities and the secrets tied to them. | ||
| MITRE ATT&CK | TA0006 — Credential Access | A leaked pull secret is a credential-access path that enables unauthorized registry use. |
| Recommendation — Map exposed image-pull credentials to TA0006 and prioritise immediate revocation. | ||
Key terms
- Kyverno: Kyverno is a Kubernetes policy engine used to define and enforce cluster rules without requiring custom admission code. It allows security teams to express controls for workloads, registries, namespaces, and privileged configurations. In practice, it turns policy intent into enforceable checks at admission time.
- ServiceAccount JWT: A ServiceAccount JWT is a JSON Web Token issued to a Kubernetes service account for workload authentication. It lets a pod present a signed bearer token to the API server or other trust boundary, with claims that identify the service account and bound scope. Short-lived tokens reduce exposure if copied or stolen.
- ImagePullSecret: An ImagePullSecret is a credential object that lets Kubernetes authenticate to a private container registry when pulling images. It extends trust beyond the application runtime into image supply and registry access, so its scope and lifecycle need to be managed like any other non-human credential.
- External Secrets Operator: An External Secrets Operator is a Kubernetes integration that synchronises secrets from an external manager into the environment that consumes them. It preserves the external system as the source of truth while making fresh, referenceable secrets available to workloads. This supports rotation without rewriting policy or deployment logic.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity, and secrets management. It gives practitioners a common model for controlling machine credentials across clusters and cloud services.
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org