DiliexPublic affairs · Policy · Society SEARCH MENU
POLICY
BRIEF
AI & ML

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

Oct 26, 2026 · 388 views

Kubernetes workload identity replaces static credentials with short-lived tokens, while requiring trusted issuers, audience checks and token rotation.

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

The identity is only the beginning

A Pod’s access to storage, a vault, a queue, another service or the Kubernetes API depends on one system recognizing which workload made the request. Kubernetes workload identity handles that through a chain: it identifies the workload, issues a credential, lets another system verify it, then applies that system’s access rules.

That distinction matters. A ServiceAccount names an identity; a signed, short-lived JWT represents it. The receiving system must trust the issuer, accept the token’s audience, check that it hasn’t expired and decide what the identity may do. A valid token alone grants no access.

For teams connecting Kubernetes to cloud IAM, this becomes a federation problem. An external identity provider can validate a Kubernetes-issued token and exchange it for permissions in another security domain. Replacing static cloud credentials with short-lived tokens therefore changes more than secret storage: it creates a distributed trust system involving issuers, signing keys, token rotation and IAM mappings. The details matter because each link can fail independently.

ServiceAccounts name workloads; tokens prove identity

A Kubernetes ServiceAccount is a non-human identity object in the API, scoped to a namespace. If a Pod doesn’t specify one, Kubernetes assigns that namespace’s default ServiceAccount. The ServiceAccount is not itself a credential: Kubernetes issues credentials separately, with their own lifetimes, audiences and bindings.

That separation lets different Pod instances use the same identity over time while receiving short-lived credentials. Authentication establishes who a workload is; authorization determines what it can do. Kubernetes uses RBAC and other authorization mechanisms to govern access to its API. External services need a cryptographically verifiable representation of the identity, which is where the token comes in.

Short-lived tokens change the credential life cycle

Modern Kubernetes clusters generally issue ServiceAccount tokens through the TokenRequest mechanism and deliver them in projected volumes. This replaced the older pattern of storing long-lived tokens in Secrets. Kubernetes has supported bound tokens and projected volumes as the standard mechanism since version 1.22.

The kubelet obtains the time-bound token through the TokenRequest API, makes it available to containers in the Pod and refreshes it before it expires. The application reads the token from the projected location and presents it to the service it needs. It must also be able to reload a replacement token; a process that assumes its startup credential will remain valid indefinitely can break when that token rotates.

Here’s the practical shift: credentials are issued and checked throughout a workload’s life, rather than embedded permanently in an environment variable or secret. That reduces reliance on permanent credentials, but it puts credential reloading on the application’s critical path.

JWT claims define where a token can be trusted

A ServiceAccount token is a signed JSON Web Token (JWT). Its claims describe the identity and the conditions under 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.

The issuer (iss) identifies who created the token; the subject (sub) identifies the represented identity. The audience (aud) names the intended recipient or security domain, and the expiration (exp) limits the token’s lifetime. Kubernetes can also bind a token to objects such as a Pod, linking the credential to the object using it.

These claims shape the trust decision. A correctly signed token can still be rejected because its issuer isn’t trusted, its audience doesn’t match or it has expired. A JWT is not just an encoded username and password: the recipient must verify the signature and evaluate the claims against its own policy.

Audience checks keep credentials in their intended domain

Suppose a Pod requests a token for a vault. If the token’s audience identifies the vault, the vault should accept it only when that audience matches its expectations. Another API should reject it. Kubernetes recommends that applications define which audiences they accept and check the token against those expectations.

The signature answers whether a trusted issuer created the token. The audience answers whether the recipient was meant to accept it. Skip that second check and a credential could be accepted outside the system it was intended for. That’s a trust boundary, not a formatting detail.

Signing keys and delivery are part of the security system

Kubernetes configures an issuer and a signing key for ServiceAccount tokens. The private key creates the signature; corresponding public verification material lets the API server or an external verifier check that the token came from a trusted issuer and hasn’t been altered. Issuer configuration and key management are therefore part of the cluster’s identity infrastructure.

Workload identity may spare an application from handling private signing keys, but the control plane still depends on managing keys, publishing verification material, rotating keys and maintaining trust relationships. For organizations already managing certificates, the pattern will be familiar: identity infrastructure has its own life cycle, and someone needs to own it.

The kubelet belongs in this picture too. Kubernetes documentation gives projected ServiceAccount tokens a default lifetime of one hour, though administrators can configure related limits and workloads can request different expiration periods within those constraints. The kubelet refreshes tokens before they expire, making credential delivery part of the runtime security path.

When authentication fails, the cause may sit anywhere along that path: Pod and ServiceAccount configuration, control-plane issuance, kubelet delivery, application token reload, audience settings or an external verifier’s trust in the issuer. Correct RBAC permissions won’t fix a token the recipient rejects.

Authentication gets an identity through the door

For the Kubernetes API, a ServiceAccount token is authenticated first; Kubernetes then evaluates the resulting identity through authorization mechanisms such as RBAC. Kubernetes recommends giving each ServiceAccount only the permissions its workload needs.

The same split applies to external IAM. A cloud provider may recognize a Kubernetes ServiceAccount and still deny access to an object storage bucket if that identity lacks the required cloud permissions. Federation proves which workload is asking. Authorization decides what it gets to do.

Federation changes the credential path, not the permission model

Replacing a static cloud key with workload identity removes a persistent credential from the Pod. It doesn’t decide what that workload is allowed to do. Identity and authorization remain separate design questions. That distinction matters when a Kubernetes workload needs a cloud service. A ServiceAccount identifies a workload inside Kubernetes; AWS, Azure and Google Cloud each have their own identity and permission systems. Federation connects those systems so a workload can prove its Kubernetes identity without storing long-lived cloud credentials in a Pod. The Kubernetes token is evidence of that identity, not a cloud credential by itself. An external provider checks its issuer, signature, audience and claims, then maps the verified identity according to its trust configuration. That’s the broader problem 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/): machines and workloads need their own security controls, rather than borrowing the identities of human users. A simplified view is: **Kubernetes identity → verified token → external identity → authorization decision** The mapping is where the design gets difficult. JWT and OpenID Connect (OIDC) provide standard mechanisms, but policy determines which namespace, ServiceAccount or workload can assume which external identity.

OIDC is the trust boundary

OIDC gives external systems a standard way to discover an issuer and validate its identity tokens. Kubernetes can publish discovery information for ServiceAccount tokens, letting outside systems act as relying parties and accept Kubernetes-issued identities. That doesn’t mean a verifier should trust a token just because it contains a familiar ServiceAccount name. It needs a configured issuer and the information required to check the token’s signature. If issuer settings change, or relying parties can’t discover updated verification keys, federation may break while the Kubernetes workload itself continues to appear healthy. There are two linked requirements: **Kubernetes trust domain → OIDC federation → external trust domain** Both cryptographic validation and the authorization mapping must succeed. Either can block access.

Tokens can follow a workload’s life cycle

When the Kubernetes API server authenticates a ServiceAccount token, it checks more than the signature. Kubernetes documents checks for the signature, expiration, object references, current validity and audience. Object binding is especially useful. A modern ServiceAccount token can be tied to an object such as a Pod; Kubernetes says deleting a bound object can invalidate the associated token. The credential can therefore track the workload’s life cycle instead of surviving indefinitely as a separate secret. A Deployment may replace a Pod while continuing to use the same ServiceAccount. The logical identity stays the same, but the new Pod can receive a different short-lived credential. In other words, stable identity doesn’t require a permanent credential. **One ServiceAccount: `payments-api`** **Pod A → Token A** **Pod B → Token B** This separation makes rolling deployments easier to manage: authorization can stay attached to the ServiceAccount while credentials are issued and replaced as Pods start, stop and rotate. A stolen, short-lived token restricted to a particular audience and workload context is also less useful than a permanent cloud key stored in a Kubernetes Secret.

Identity is not a Secret

A Kubernetes Secret stores sensitive data: passwords, API keys, certificates, tokens or other credentials. Workload identity establishes who a workload is, so another system can issue or accept credentials based on that identity. The two can work together, but they solve different problems. Kubernetes still supports manually created, long-lived ServiceAccount token Secrets. The project recommends TokenRequest instead, which supplies time-limited credentials and reduces the exposure created by persistent tokens. Secrets still have a place in Kubernetes; an application’s need to authenticate somewhere doesn’t automatically mean its identity should be a static secret.

ServiceAccounts and SPIFFE address different scopes

ServiceAccounts are one way to give workloads identities, but they aren’t the whole cloud-native identity model. SPIFFE defines a broader framework. Its identities can be represented by SVIDs, including X.509 certificates used for mutual TLS (mTLS) and other authentication methods. Kubernetes documentation identifies SPIFFE-based options for Pods, including the SPIFFE CSI driver, which provides X.509 certificate pairs. ServiceAccount tokens are a natural fit when the target understands Kubernetes identities or OIDC federation. SPIFFE can suit organizations that need one workload identity model across Kubernetes clusters, service meshes, virtual machines and other infrastructure. The shared requirement is straightforward: workloads need identities that can be verified cryptographically and mapped to permissions. That’s also where PKI enters the picture. X.509 identities and mTLS bring certificate issuance, trust anchors, private keys, rotation and life-cycle 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/), particularly in distributed environments. The topic also connects to [client certificate authentication](https://comparecheapssl.com/what-is-the-difference-between-a-client-certificate-and-server-certificate/): at the transport layer, a client proves it holds the private key associated with its certificate.

More identity mechanisms mean more dependencies

Kubernetes workload identity can look like a JWT and OIDC problem at first. In a larger environment, several mechanisms may coexist: the Kubernetes control plane uses signed JWTs for ServiceAccount authentication, a cloud provider accepts OIDC federation, a service mesh issues X.509 certificates, and internal services use mTLS. External systems may rely on certificates, private keys or other cryptographic credentials. A simplified dependency map might look like this: **Kubernetes JWT → Kubernetes API** **OIDC federation → Cloud IAM** **SPIFFE → mTLS** Each path brings its own trust relationships and life-cycle requirements. An issuer, signing key, certificate authority, discovery endpoint or authorization mapping can fail in a way that first looks like an application authentication bug. For enterprises running large Kubernetes estates, workload identity is security infrastructure, not just a configuration choice. A Pod can be running normally, with its ServiceAccount, RBAC settings and token file all in place, while an external service rejects its request. The issuer may not be trusted; the audience may be wrong; a signing key may be unverifiable; the token may have expired; or the external identity may map to the wrong permissions. The failure chain often crosses teams. Platform engineering may own Kubernetes, security may own identity policy, cloud engineering may own IAM, and application teams may own token use and reload behavior. Without clear ownership, each component can look healthy when checked by its own team, leaving a cross-team investigation to explain the rejection.

Design around identity, permissions and operations

Start by deciding which workloads share an identity and which need separate ones. The boundary might follow namespaces, applications, environments, tenants or another organizational structure. Then choose how credentials reach those workloads. Prefer short-lived tokens when the receiving system supports them. Kubernetes provides TokenRequest and projected volumes for this model, with the kubelet handling automatic token refresh. Set audience restrictions as part of the security design: a token intended for one service shouldn’t automatically work as a general-purpose credential elsewhere. Next, define least-privilege authorization. A cloud IAM role, Kubernetes RBAC role or external resource permission should match the workload’s actual needs, not copy the access granted to a human administrator. Finally, operate issuers, signing keys, verification keys, OIDC discovery, certificate authorities and workload credentials as production infrastructure. That overlaps with the broader 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 distributed dependencies across the platform. Workload identity is often summarized as a way to remove static credentials from Pods. That’s a useful outcome, but the mechanism underneath is a distributed trust system. Kubernetes establishes a ServiceAccount identity, issues and delivers a signed credential, and provides ways to validate its claims. External systems can then federate that identity into their own security domains. The result can be more resilient than placing permanent credentials in Pods: tokens can expire quickly, audiences can limit where they’re accepted, and object bindings can connect credentials to workload life cycles. But access still depends on issuer configuration, signing keys, audiences, kubelet behavior, OIDC discovery, external IAM mappings and authorization policy. A workload may see only a token file. The platform is operating a trust system, and once Kubernetes identities are used across other infrastructure, that system becomes part of the security architecture for the whole cloud-native environment.

What Kubernetes workload identity changes

Kubernetes workload identity gives applications in Pods a way to prove who they are without carrying permanent credentials. A Pod’s application can use a ServiceAccount and a cryptographically signed token to authenticate to the Kubernetes API or an external service. That’s a meaningful security improvement: credentials can expire instead of lingering in configuration files or secrets. The protocol layer matters when the workload needs access beyond the cluster. With OIDC federation, a cloud identity provider can check a Kubernetes-issued token’s issuer, signature, audience and claims, then map the verified workload to an external identity with defined permissions. The provider’s validation rules determine whether that bridge is trustworthy. Short-lived ServiceAccount tokens also limit the damage from theft. They expire, can be scoped to an audience, and may be tied to a specific workload object. The kubelet can rotate them automatically. Those controls reduce exposure, though they don’t remove the need to set careful permissions and validate tokens correctly.
Source: Michael Carter · cloudnativenow.com

Discussion

Sign in to join the discussion.