Take a small company running a payments-api service. It runs as pods in a Kubernetes cluster in the company's own data centre, and it has to:
- read invoices from an S3 bucket in AWS,
- call an internal
ledgerservice, which must accept requests only frompayments-api, and - be called by a
checkoutservice that runs on a VM, not in Kubernetes.
The setup, with the identity question each connection has to answer:

Each of these needs the same thing: one side has to prove to the other that it is payments-api (or checkout). Here is how teams usually try to do that, and where each attempt breaks.
Attempt 1: trust the network
The ledger service allows requests from the subnet where payments-api runs, and the S3 bucket policy allows the data centre's public IP.
This fails because network location isn't identity. Pod IPs change whenever a pod is replaced, and every other pod on the same nodes shares the same subnet and the same outbound IP. A firewall rule can say where a request came from, but not which service sent it. Any compromised pod in the cluster can call ledger and read the bucket.
Attempt 2: give the service a secret
Next, the team creates an IAM user for payments-api, puts its access key in a Kubernetes Secret, and gives ledger a shared API key.
This works, and it creates new problems:
- The AWS key never expires. Rotating it means updating the Secret, restarting pods and hoping nothing else uses the old key, so rotation gets postponed.
- The key gets copied: into a CI variable to run integration tests, onto a laptop to debug, into a Helm values file by mistake.
- Whoever has the key is
payments-apias far as AWS andledgercan tell. The key proves possession, not identity.
Attempt 3: put the secrets in a vault
So the team moves the keys into a secrets manager such as HashiCorp Vault, which can even issue short-lived AWS credentials. That is a real improvement, but every workload now has to log in to Vault first. Inside Kubernetes, payments-api can log in with its service account token. The checkout VM has no such token, so it usually gets a static login credential (an AppRole secret ID, for example) that someone has to deliver to the machine. The team is back to one secret that gives access to all the others. This is the secret zero problem: somewhere, a first credential has to be handed to the workload.
Attempt 4: use the cloud's own workload identity
On EKS, the team would use IAM Roles for Service Accounts or EKS Pod Identity: pods get AWS credentials based on their Kubernetes service account, with no keys at all. GKE and Azure have similar features.
But the cluster runs in the company's data centre, not on EKS. Even if it did run on EKS, that identity is only understood by AWS. It means nothing to the ledger service, and the checkout VM has no Kubernetes service account at all. Each platform has its own identity system, and none of them work across platforms.
Four requirements no attempt met, and how SPIFFE meets them
The four attempts add up to five requirements. payments-api needs an identity that:
| Requirement | Why the earlier attempts fell short |
|---|---|
| Names the service, not its IP or host | Network rules can't tell services apart (attempt 1) |
| Is issued automatically, with nothing pre-shared | Static keys and vault logins need a first secret (attempts 2 and 3) |
| Is short-lived and rotated without anyone acting | Static keys live until someone rotates them (attempt 2) |
| Works on Kubernetes, VMs and bare metal, in any data centre or cloud | Cloud identity only works inside one cloud (attempt 4) |
| Is accepted by internal services and by AWS and other clouds | Cloud identity means nothing to internal services (attempt 4) |
SPIFFE is an open standard built for these requirements, and SPIRE is the software that implements it. In the SPIFFE model:
payments-apigets a name,spiffe://example.org/ns/payments/sa/api, that doesn't depend on where it runs.- It gets proof of that name without presenting any secret: the system inspects the running process and the node it's on, and issues an identity document only if they match a registered rule.
- Those documents last minutes to an hour and are renewed automatically.
- The same identity works for mutual TLS with
ledgerandcheckout, as a token for internal APIs, and, through standard OIDC federation, to get temporary AWS credentials with no AWS keys anywhere.
SPIFFE: the specification for workload identity
SPIFFE (Secure Production Identity Framework For Everyone) is a set of open specifications, graduated in the CNCF, that define how a workload is identified and how it proves that identity. SPIFFE is a standard, not a product. It defines four building blocks.
SPIFFE ID
A SPIFFE ID is a URI that uniquely identifies a workload, for example spiffe://example.org/ns/payments/sa/api. The authority part, example.org, is the trust domain: the trust boundary of one identity system, typically an organisation or an environment. The path identifies the workload within the trust domain; on Kubernetes the common convention is namespace plus service account. The ID describes what the workload is, not its IP or host.
SVID (SPIFFE Verifiable Identity Document)
An SVID is the cryptographically verifiable document a workload presents to prove its SPIFFE ID. There are two formats:
| X.509-SVID | JWT-SVID | |
|---|---|---|
| Format | X.509 certificate with the SPIFFE ID in the URI SAN | JWT signed by the trust domain, with the SPIFFE ID in the sub claim |
| Typical use | Mutual TLS between services | Bearer token for APIs, cloud providers and Vault, scoped by the aud claim |
| Lifetime | Short, typically an hour | Shorter, typically minutes |
Trust bundle
The trust bundle is the set of public keys (CA certificates for X.509-SVIDs and signing keys for JWT-SVIDs) for a trust domain. A relying party uses it to validate SVIDs locally, without calling the issuer. Exchanging bundles between trust domains is called federation, and lets workloads in different trust domains authenticate each other.
Workload API
The Workload API is a local API, exposed over a Unix domain socket on each node, through which a workload fetches its SVIDs and the trust bundle. The workload presents no credential when it calls it. The implementation identifies the caller by inspecting the calling process, a step called workload attestation. Requesting an identity without a pre-shared secret is what removes the secret zero problem.
SPIRE: the reference implementation of SPIFFE
SPIRE (the SPIFFE Runtime Environment) is the production-grade reference implementation of the SPIFFE specifications, also a graduated CNCF project. It issues SVIDs, attests nodes and workloads, and rotates keys and SVIDs automatically. A Kubernetes deployment typically consists of four components:

SPIRE Server: the signing authority of the trust domain
The SPIRE Server is the central authority of a trust domain. It:
- runs the signing CA that issues X.509-SVIDs and signs JWT-SVIDs, and rotates its own signing keys. It can act as the root CA or chain to an existing PKI through an upstream authority.
- stores registration entries. An entry maps a set of selectors (properties of a workload) and a parent ID (the agent or node it may run under) to a SPIFFE ID. For example: pods with
k8s:ns:paymentsandk8s:sa:apireceivespiffe://example.org/ns/payments/sa/api. - performs node attestation on the server side, verifying the evidence each agent presents before issuing the agent its own SVID.
- publishes the trust bundle to agents, and optionally to external locations.
Its state is a datastore (SQLite, or PostgreSQL/MySQL for high availability) and a key manager that holds the CA private keys (on disk, in memory, or in a KMS such as AWS KMS).
SPIRE Agent: node attestation and workload attestation
The SPIRE Agent runs on every node (a DaemonSet on Kubernetes) and serves the Workload API to local workloads. Workloads never talk to the server directly.
- Node attestation. At startup the agent proves the node's identity to the server with platform-issued evidence: a projected Kubernetes service account token (
k8s_psat), an AWS instance identity document (aws_id), GCP and Azure equivalents, a TPM, or a one-time join token. - Workload attestation. When a process calls the Workload API, the agent reads the caller's PID from the kernel and collects selectors about it through workload attester plugins: namespace, service account, labels and image from the kubelet (
k8s), or UID and binary path (unix). It returns the SVIDs whose registration entries match those selectors. - Caching and rotation. The agent caches SVIDs and renews them before they expire. New X.509-SVIDs are pushed to workloads that hold an open Workload API stream, and JWT-SVIDs are minted on request, so rotation needs no restarts.
On Kubernetes, the SPIFFE CSI driver mounts the Workload API socket into pods, so workloads don't need hostPath volumes.
SPIRE Controller Manager: Kubernetes-native workload registration
Pods are created and deleted continuously, so registration entries can't be maintained by hand. The SPIRE Controller Manager runs alongside the SPIRE Server and reconciles registration entries from Kubernetes custom resources:
ClusterSPIFFEID: a template that assigns SPIFFE IDs to every pod matching a pod and namespace selectorClusterStaticEntry: a fixed entry, typically for workloads outside the clusterClusterFederatedTrustDomain: a federation relationship with another trust domain
A single resource can cover the whole cluster:
apiVersion: spire.spiffe.io/v1alpha1
kind: ClusterSPIFFEID
metadata:
name: by-service-account
spec:
className: spire-mgmt-spire # must match the controller manager's class
spiffeIDTemplate: "spiffe://{{ .TrustDomain }}/ns/{{ .PodMeta.Namespace }}/sa/{{ .PodSpec.ServiceAccountName }}"
podSelector: {}The className matters: the controller manager only processes resources whose class matches its own, and with the official Helm charts it ignores resources without a class by default. Those charts also ship a default ClusterSPIFFEID with this exact template, so a fresh install already gives every pod a namespace and service account based identity.
The controller creates an entry when a matching pod appears and removes entries that no longer match, so a workload's identity follows its Kubernetes namespace and service account automatically.
OIDC Discovery Provider: federating SPIRE with OIDC relying parties
Token-exchange services such as AWS STS, GCP Workload Identity Federation and Azure federated credentials don't read SPIFFE trust bundles, but they do trust OpenID Connect (OIDC) identity providers. A JWT-SVID is a standard signed JWT, so SPIRE only needs to publish its signing keys the way OIDC expects. The OIDC Discovery Provider serves:
/.well-known/openid-configuration: the discovery document, containing the issuer and the JWKS URI/keys: the JWKS (JSON Web Key Set), SPIRE's current public JWT signing keys
It reads the keys from the SPIRE Server API or an agent's Workload API and picks up key rotation automatically. It must be reachable over public HTTPS with a publicly trusted certificate. The server's jwt_issuer setting must be set to the provider's URL, so the iss claim in every JWT-SVID matches the issuer the provider advertises, exactly. Any OIDC relying party (AWS IAM, GCP Workload Identity Federation, Azure federated credentials, HashiCorp Vault's JWT auth) can then validate SPIRE-issued JWT-SVIDs.
Issuing an SVID, from pod creation to rotation
Putting the components together, this is how payments-api receives its identity:

The agent itself was attested once, when it started on the node.
Authenticating the three connections with SPIFFE identities
Each connection from the opening example now uses the same identity.
payments-api → ledger: mutual TLS with X.509-SVIDs. Both sides present X.509-SVIDs during the TLS handshake and validate the peer's certificate against the trust bundle. ledger then authorises the caller by SPIFFE ID, accepting only spiffe://example.org/ns/payments/sa/api. This can be done in code with the SPIFFE libraries (go-spiffe, java-spiffe, py-spiffe).
checkout VM → payments-api: one trust domain across platforms. The VM runs its own SPIRE agent, which joins the same SPIRE Server using a node attester suited to an on-prem machine, such as join_token, x509pop or tpm_devid. A registration entry on the server, parented to that agent and using unix selectors (for example the process's user ID), assigns checkout its SPIFFE ID. The VM workload then receives an X.509-SVID from the same trust domain, so payments-api validates it exactly as it would a pod's.
payments-api → S3: keyless AWS access with JWT-SVIDs. SPIRE's issuer URL is registered in AWS as an IAM OIDC identity provider with audience sts.amazonaws.com. An IAM role's trust policy allows sts:AssumeRoleWithWebIdentity only for that provider, that audience and one subject:
"Condition": {
"StringEquals": {
"oidc.example.org:aud": "sts.amazonaws.com",
"oidc.example.org:sub": "spiffe://example.org/ns/payments/sa/api"
}
}The pod requests a JWT-SVID with that audience and exchanges it with AWS STS for temporary credentials. The AWS SDKs do this when AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE are set; the spiffe-helper sidecar keeps a fresh JWT-SVID in that file.

No AWS access key exists in the cluster, in Git or in CI. The same pattern applies to GCP, Azure and Vault.
Static secrets compared with SPIFFE identities
How the two approaches compare:
| Static secrets | SPIFFE identities (SVIDs) | |
|---|---|---|
| Issuance | Created and distributed by a person | Issued automatically after node and workload attestation |
| Lifetime | Until someone rotates it | Minutes to an hour |
| Rotation | Manual | Automatic, handled by the agent |
| If leaked | Valid until revoked | Expires on its own |
| What it proves | Possession of the key | The workload's identity, attested by the platform |
| Scope | One credential per system | One identity for mTLS, APIs and cloud federation |
Operational considerations when running SPIRE
- Protect the SPIRE Server. Its signing keys are the root of trust. Run it highly available with a shared datastore, back it up, and prefer a KMS-backed key manager.
- Keep the OIDC Discovery Provider available. If it is unreachable or its certificate expires, relying parties can't fetch the keys and
AssumeRoleWithWebIdentitycalls start failing. - Match SPIFFE IDs exactly. Use
StringEqualson the full ID in trust policies and authorisation rules; a wildcard such asspiffe://example.org/*admits every workload in the trust domain. - Treat Kubernetes RBAC as part of identity. If IDs derive from namespace and service account, anyone who can run a pod with that service account receives that identity.
- Use a distinct audience per relying party, so a JWT-SVID issued for one service can't be replayed against another.
SPIFFE defines the identity, SPIRE issues and proves it
Every attempt in the opening example tied identity to a network location, a secret or a single platform. SPIFFE replaces all three with a SPIFFE ID and short-lived SVIDs that work anywhere. SPIRE implements it: the server signs SVIDs and holds registration entries, the agent performs node and workload attestation, the controller manager keeps entries in sync with Kubernetes, and the OIDC Discovery Provider lets cloud providers validate JWT-SVIDs. The result is one identity for mutual TLS, API authentication and keyless cloud access, with no long-lived secrets.
References
- SPIFFE overview and specifications: https://spiffe.io/docs/latest/spiffe-about/overview/
- SPIRE concepts: https://spiffe.io/docs/latest/spire-about/spire-concepts/
- SPIRE Controller Manager: https://github.com/spiffe/spire-controller-manager
- OIDC Discovery Provider: https://github.com/spiffe/spire/tree/main/support/oidc-discovery-provider
- spiffe-helper: https://github.com/spiffe/spiffe-helper
- AWS IAM OIDC identity providers: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html
