Kubernetes Workload Identity: How Short-Lived Tokens Secure Cloud Access

Oct 26, 2026 830 views

Workload identity is a trust chain, not a mounted secret

A Kubernetes Pod that reads from object storage, calls a vault, publishes to a queue or reaches the Kubernetes API has to prove which workload is making the request. The key point is that Kubernetes workload identity isn’t just a way to hand Pods credentials. It’s a chain: Kubernetes identifies the workload, issues a signed token, and the receiving system checks that token before deciding what the identity may do. That distinction matters. A ServiceAccount names an identity inside the cluster; a token represents that identity to another system. Issuer, subject, audience and expiration claims help define who issued the token, whom it represents, where it can be used and how long it remains valid. A receiver must trust the issuer, accept the token’s audience and apply its own authorization policy. A valid signature alone doesn’t grant access. For teams connecting Kubernetes to cloud IAM, this chain can cross security domains. An external identity provider may validate a Kubernetes token and exchange it for cloud permissions. That can replace permanent cloud credentials with short-lived ones, but it also makes issuer configuration, signing keys, token rotation and IAM mappings part of the security system. If you work in this space, that’s the part to understand: identity depends on several components working together, and any link can fail.

A ServiceAccount identifies the workload

A Kubernetes ServiceAccount is a non-human identity stored in the Kubernetes API. It belongs to a namespace, so it isn’t a universal identity shared across the cluster. If a Pod doesn’t name a ServiceAccount, Kubernetes assigns the namespace’s default one. The ServiceAccount is not itself a credential. Kubernetes associates it with the workload, then issues credentials separately. Multiple Pod instances can use the same ServiceAccount identity over time while receiving short-lived tokens that are rotated. That separation lets Kubernetes represent a workload without relying on a permanent secret as its identity. Authentication and authorization remain distinct. Authentication establishes who the workload is; authorization determines what that identity can access. Kubernetes uses mechanisms such as RBAC to decide what a ServiceAccount may do. An external service needs a cryptographically verifiable token, not just the ServiceAccount’s name.

Short-lived tokens change the credential life cycle

Modern Kubernetes clusters generally issue ServiceAccount tokens through the TokenRequest mechanism and make them available through projected volumes. This replaced the older approach of storing long-lived ServiceAccount tokens in Secrets. Kubernetes has supported bound tokens and projected volumes as the standard mechanism since version 1.22. The kubelet obtains a time-bound token through the TokenRequest API, makes it available to the Pod’s containers and refreshes it before it expires. The application reads the token from the projected location and presents it to the service it wants to reach. That design puts a requirement on the application: it must be able to reload its credential. A process that reads a token once at startup and assumes it will stay valid may fail after rotation. This is a real change from placing a secret in an environment variable and leaving it there. Credentials now have a managed life cycle.

JWT claims define where a token can be trusted

A ServiceAccount token is a signed JSON Web Token (JWT). It carries claims about the identity and the context in which the token should be accepted. Kubernetes documentation lists claims including `iss`, `sub`, `aud`, `exp`, `iat` and `jti`, along with Kubernetes-specific information about the ServiceAccount, Pod and related objects. These claims shape the trust decision. `iss` names the issuer; `sub` identifies the subject; `aud` identifies the intended recipient or security domain; and `exp` sets the token’s expiration. Kubernetes can also bind a token to objects such as a Pod. A correctly signed token can still be rejected. The issuer may not be trusted, the audience may be wrong or the token may have expired. A JWT is not simply an encoded username and password: the receiver must verify its signature and assess its claims against local policy. The audience claim is a particularly useful boundary. A Pod might request a token intended for a vault, with an audience identifying that service. The vault should accept it only if the audience matches its expectations; another API should reject it if it wasn’t an intended recipient. Kubernetes recommends that applications define and verify the audiences they accept. A trusted signature shows who created a token, while audience validation helps show where it belongs.

Signing keys and delivery are part of the security system

Kubernetes configures a ServiceAccount token issuer and signing key, while the API server maintains the verification material used to validate tokens. The private key signs a token; a verifier uses corresponding public material to check that a trusted issuer created it and that the token hasn’t been altered. That makes issuer configuration and key management part of cluster identity infrastructure. Workloads may never handle private signing keys, but the control plane still depends on key storage, verification material, rotation procedures and managed trust relationships. For organizations familiar with certificate life cycles, the pattern will feel familiar: this infrastructure needs an owner. The kubelet is another part of that path. A projected token may look to an application like a file Kubernetes simply mounts, but the kubelet helps obtain and maintain the credential. Kubernetes documentation gives projected ServiceAccount tokens a default lifetime of one hour; administrators can configure related limits, and workloads can request different expiration periods within those constraints. The kubelet refreshes projected tokens before expiry. So a failed request may have several possible causes. The ServiceAccount and its RBAC permissions could be correct, while the audience is wrong, an external verifier distrusts the issuer, the token has expired or the application hasn’t reloaded a rotated token. Workload identity is infrastructure precisely because those pieces have to line up.

Proving identity does not grant permission

Authentication answers “Who is making this request?” Authorization answers “What may that identity do?” For the Kubernetes API, the token authenticates the ServiceAccount, and an authorization system such as RBAC determines the actions it can perform. Kubernetes recommends giving each ServiceAccount only the permissions its workload needs. The same rule applies across cloud integrations. A cloud provider may authenticate a Kubernetes ServiceAccount successfully and still deny access to an object storage bucket because the identity lacks the necessary cloud-side permissions. Federation establishes a trusted identity across systems; each system still controls what that identity can do.

Federation moves the hard question to authorization

Replacing a static cloud key with workload identity changes how a workload proves who it is and obtains a credential. It doesn’t decide what that identity is allowed to do. That distinction matters: federation can remove a long-lived secret from a Pod while leaving permission design entirely in place. A Kubernetes ServiceAccount belongs to Kubernetes’ identity system. AWS, Azure and Google Cloud each have their own. Workload identity federation connects those systems so a workload can reach cloud services without embedding permanent cloud credentials in its Pod. The Kubernetes-issued token serves as evidence of the workload’s identity; the external provider checks its issuer, signature, audience and claims, then maps it to an identity under that provider’s trust rules. That mapping is where the policy work begins. The JWT and OpenID Connect (OIDC) mechanisms may be standard, but administrators still need to decide which namespace, ServiceAccount or workload can assume which external identity. The broader principle—that machines and workloads need identities with their own security controls—is explored in Cloud Native Now’s coverage of [machine and workload identity](https://cloudnativenow.com/social-facebook/machines-and-workloads-need-identities-too-not-just-humans/). A simplified federation flow looks like this: —————— The Kubernetes token doesn’t turn into a cloud credential by itself. The external provider must trust the Kubernetes issuer and define how a verified Kubernetes identity maps into its authorization model. Get either the trust relationship or the mapping wrong, and access fails.

OIDC is the boundary between trust domains

OIDC gives external systems a standard way to discover an issuer and validate its identity tokens. Kubernetes can publish discovery information for ServiceAccount tokens, allowing external systems to rely on Kubernetes-issued identities. Kubernetes documentation describes this discovery mechanism as a way for external systems to act as relying parties and federate with those identities. A verifier shouldn’t accept a JWT just because it contains a familiar ServiceAccount name. It needs a trust configuration that identifies the issuer and supplies what’s required to validate the signature. Issuer settings and verification keys therefore become operational dependencies: a change that relying parties can’t discover may break federation even while the workload itself appears healthy. Kubernetes trust domain → OIDC → external trust domain Both cryptographic validation and authorization mapping have to succeed. Either can be the point of failure.

Tokens follow workload lifecycles

When the Kubernetes API server authenticates a ServiceAccount token, it checks more than the signature. Kubernetes documents checks for expiration, object references, current validity and audience as well. Object binding is particularly useful. Modern ServiceAccount tokens can be bound to objects such as Pods, and Kubernetes says a token can become invalid when its bound object is deleted. That lets a credential’s lifetime track the workload instead of leaving a persistent token behind as an independent secret. Say a Deployment replaces a Pod. The replacement can use the same ServiceAccount, but that doesn’t mean the old Pod’s credential remains valid for the new instance. The logical identity can stay constant while the credential and its binding change. That separation is central to short-lived workload credentials. A common misunderstanding is that every Pod needs a distinct workload identity. A Deployment might consistently use a ServiceAccount such as `payments-api`, while individual Pods receive different, temporary credentials. The ServiceAccount identifies the logical workload; each projected token is a credential for a particular runtime context. v v Pod A Pod B v v Token A Token B This makes rolling deployments easier to manage: authorization can remain attached to the ServiceAccount as credentials are issued and replaced. It also limits the value of a stolen token. A short-lived credential restricted to an audience and workload context poses a different risk from a permanent cloud key stored in a Kubernetes Secret.

Identity isn’t the same as a Secret

A Secret stores sensitive data: passwords, API keys, certificates, tokens and other credentials. Workload identity establishes who a workload is, so another system can issue or accept credentials based on that identity. The two can coexist, but they solve different problems. Versus: Kubernetes still supports manually created, long-lived ServiceAccount token Secrets. The project recommends TokenRequest instead, which provides time-limited credentials and reduces the exposure created by persistent tokens. Secrets don’t vanish from Kubernetes architectures; the point is that authentication doesn’t have to begin with a static secret simply because an application needs to access another system.

SPIFFE and PKI broaden the picture

ServiceAccounts are one way to give a workload an identity, not the whole cloud-native identity model. SPIFFE defines a broader framework and represents identities through SVIDs, including X.509 certificate identities that can support mutual TLS (mTLS) and other authentication. Kubernetes documentation identifies SPIFFE-based options for Pods, including the SPIFFE CSI driver for providing X.509 certificate pairs. ServiceAccount tokens fit naturally when the target understands Kubernetes or OIDC federation. SPIFFE can make more sense when identity needs to span clusters, service meshes, virtual machines and other infrastructure. The shared requirement is straightforward: workloads need identities that can be verified cryptographically and tied to authorization decisions. That’s also where public key infrastructure (PKI) enters the design. X.509 identities and mTLS bring certificate issuance, trust anchors, private keys, rotation and lifecycle management into the workload identity system. Cloud Native Now has examined [PKI challenges in Kubernetes](https://cloudnativenow.com/topics/cloudnativedevelopment/kubernetes/pki-for-kubernetes-are-you-set-up-for-security-and-scale/), especially as environments become more distributed. The transport layer has a related mechanism: with [client certificate authentication](https://comparecheapssl.com/what-is-the-difference-between-a-client-certificate-and-server-certificate/), a client proves it holds the private key associated with its certificate. At first, workload identity can look like a JWT and OIDC problem. In a larger environment, several systems may operate at once: Kubernetes uses signed JWTs for ServiceAccount authentication, a cloud provider accepts OIDC federation, a service mesh issues X.509 certificates, and internal services rely on mTLS or other cryptographic credentials. Kubernetes JWT → Kubernetes API OIDC federation → Cloud IAM SPIFFE → mTLS Each path carries its own trust relationships and lifecycle requirements. A broken issuer, signing key, certificate authority, discovery endpoint or authorization mapping can show up as what looks like an application authentication error. For enterprises running large Kubernetes estates, workload identity is security infrastructure.

The operational dependency chain

A Pod can be running normally, its ServiceAccount can exist, its RBAC rules can look right, and the application can read its token—yet an external service can still reject the request. The issuer may be untrusted, the audience wrong, the signing key unverifiable, the token expired or the identity-to-permission mapping incorrect. Ownership is often spread across teams. Platform engineering may run Kubernetes, security may set identity policy, cloud engineering may own IAM, and application teams may handle token consumption and reloads. Without clear boundaries, an authentication failure can turn into a cross-team investigation where each component looks healthy in isolation. Start design by defining the identity boundary: which workloads share an identity, which need separate identities, and whether the boundary follows a namespace, application, environment, tenant or another organizational unit. Then choose credential lifetimes. Where the target system supports them, short-lived tokens are generally preferable to permanent credentials. Kubernetes provides TokenRequest and projected volumes for this model, with the kubelet able to refresh tokens automatically. Audience restrictions belong in the security design, too. A token issued for one service shouldn’t automatically work as a general-purpose credential elsewhere. Authorization still needs least-privilege policies: cloud IAM roles, Kubernetes RBAC roles and external resource permissions should reflect the workload’s actual needs, not simply mirror a human administrator’s access. Finally, treat issuers, signing keys, verification keys, OIDC discovery, certificate authorities and workload credentials as production infrastructure with lifecycle requirements. That connects directly to the challenge of [managing PKI at Kubernetes scale](https://cloudnativenow.com/topics/cloudnativedevelopment/kubernetes/pki-for-kubernetes-are-you-set-up-for-security-and-scale/): identity and certificate services can become dependencies distributed across the platform. Workload identity is often summarized as a way to remove static credentials from Pods. That’s a real benefit, but it describes the result, not the machinery behind it. Kubernetes establishes an identity through a ServiceAccount, issues a signed credential and provides ways to deliver and validate it. External systems can then establish federation relationships and interpret that identity within their own security domains. Short lifetimes, audience restrictions and object bindings can make this model more resilient than storing permanent credentials in Pods. They also make the final access decision depend on issuer settings, signing keys, token audiences, kubelet behavior, OIDC discovery, external IAM mappings and authorization policy. The application may see only a token file. The platform is operating a trust system. Once Kubernetes serves as an identity provider for other infrastructure, that system becomes part of the security architecture of the wider cloud-native environment.

What Kubernetes workload identity changes

Kubernetes workload identity gives applications running in Pods a way to prove who they are using ServiceAccounts and cryptographically signed tokens. That matters because workloads can reach Kubernetes APIs and external services without carrying permanent credentials in their configuration.

The security benefit depends on how those tokens are scoped and managed. Short-lived tokens expire, can target a specific audience, and may be tied to an individual workload object. The kubelet can also rotate them automatically, narrowing the window in which a stolen token is useful. This is more significant than it looks: credential rotation and limited scope reduce the damage a leaked secret can cause.

Connecting Kubernetes identities to cloud permissions

OIDC federation lets an external system, such as a cloud IAM provider, check a Kubernetes-issued ServiceAccount token. The provider verifies the issuer, signature, audience, and relevant claims, then maps the workload to an external identity with defined permissions.

That’s the practical bridge: Kubernetes establishes the workload’s identity, while the external provider decides what that identity may access. If you’re building this into a platform, the trust configuration and permission mapping deserve close attention. The token proves identity; it doesn’t, by itself, guarantee that the resulting access is appropriately limited.

Source: Michael Carter · cloudnativenow.com

Comments

Sign in to comment.
No comments yet. Be the first to comment.

Related Articles

How Kubernetes Workload Identity Actually Works at the Pr...