What are SPIFFE and SPIRE? Workload identity without shared secrets
Learn about SPIFFE IDs, X.509 and JWT SVIDs, trust domains, and the Workload API, how SPIRE issues identities with node and workload attestation, and why this is workload identity, not a KMS.
Kubernetes$ spire-agent api fetch -socketPath /run/spire/sockets/agent.sock▍How does the payments service prove to the database that it really is the payments service? The usual answer is a password in an environment variable, a token in a Secret, or an IP-based firewall rule. All of them depend on a secret distributed in advance, or on an address that changes every time the pod is rescheduled. SPIFFE goes after the root of the problem: every workload gets a verifiable, short-lived, automatically rotated identity, without anyone having to put an initial secret in the container.
It’s common to hear “SPIFFE for key management,” and the confusion is understandable, since there are keys and certificates everywhere. But SPIFFE is about workload identity, not about storing your application’s keys the way a KMS does. Let’s separate the two.
What SPIFFE and SPIRE are
SPIFFE (Secure Production Identity Framework For Everyone) is a set of open specifications: how to name a workload (SPIFFE ID), which document proves that identity (SVID), how the workload obtains that document (Workload API), and how different domains trust each other (federation).
SPIRE (SPIFFE Runtime Environment) is the reference implementation of those specifications: a server and agents that attest nodes and workloads and issue identities. Both joined the CNCF in 2018 and have been graduated since 2022, as of November 2026 (check the project page). The latest SPIRE version on the releases page during this research was v1.16.0. Apache 2.0 license.
It’s not a KMS
| Classic KMS (AWS KMS, Vault Transit…) | SPIFFE/SPIRE | |
|---|---|---|
| Question it answers | “Where do I store and use this key safely?” | “Who is this workload, and how does it prove it?” |
| Unit | Data encryption key | Workload identity (SPIFFE ID) |
| Lifetime | Long, with planned rotation | Short (SPIRE issues X.509-SVIDs with a 1-hour default TTL), automatic rotation |
| How the client authenticates | Needs a prior credential | Platform attestation, no initial secret |
| Typical use | Encrypting data, signing artifacts | Service-to-service mTLS, API authentication |
The two complement each other: SPIRE can keep its own signing keys in a KMS (there are KeyManager plugins such as aws_kms and hashicorp_vault), and a workload with an SVID can use it to authenticate to the KMS without a static credential.
What problem it solves
- Secret zero: to fetch a secret, a service needs a credential; SPIFFE replaces that initial credential with attestation.
- Network-independent identity: IPs change and are shared; a SPIFFE ID follows the workload across Kubernetes, VMs, or bare metal.
- mTLS without manual certificate management: issuance, rotation, and trust bundle distribution are automatic.
- Heterogeneous environments: the same identity scheme works across clusters, clouds, and data centers, with federation between trust domains.
How it works
| Concept | What it is |
|---|---|
| Trust domain | The root of trust of a system, such as example.com. Use separate domains for environments with different security practices |
| SPIFFE ID | A URI that identifies the workload: spiffe://<trust-domain>/<path>, such as spiffe://example.com/ns/payments/sa/api |
| X.509-SVID | An X.509 certificate with the SPIFFE ID in the URI SAN, plus a private key; the recommended format |
| JWT-SVID | A JWT carrying the SPIFFE ID; useful when there’s an L7 proxy in the middle, but open to replay |
| Trust bundle | Root certificates (and public keys, for JWT) used to validate SVIDs |
| Workload API | A local API, with no caller authentication, that delivers SVIDs and bundles to the workload |
SPIRE: server, agent, and attestation
- SPIRE Server: the signing authority for the trust domain. It stores registration entries (which SPIFFE ID each workload gets), authenticates agents, and signs SVIDs. It can be its own CA or chain to an existing PKI through UpstreamAuthority plugins.
- SPIRE Agent: runs on every node (a DaemonSet on Kubernetes), exposes the Workload API on a Unix socket, and keeps an SVID cache.
- Node attestation: the agent proves to the server which machine it’s on, using platform evidence: a projected service account token (
k8s_psat), the AWS instance identity document (aws_iid), GCP, Azure, TPM, or a single-use join token. - Workload attestation: when a process calls the Workload API, the agent finds the caller’s PID and queries the kernel and the kubelet to get selectors (namespace, service account, labels, UID, binary path). If the selectors match a registration entry, the process gets the SVID.
Nobody hands the workload a secret: the identity comes from what the platform can assert about it.
Hands-on example
With SPIRE installed in the cluster (through the project’s Helm charts, for example), register the agent and a workload. Commands follow the official Kubernetes guide and were not run in this lab:
# node entry: agents attested by PSAT in this cluster
kubectl exec -n spire spire-server-0 -- \
/opt/spire/bin/spire-server entry create \
-spiffeID spiffe://example.com/ns/spire/sa/spire-agent \
-selector k8s_psat:cluster:production \
-selector k8s_psat:agent_ns:spire \
-selector k8s_psat:agent_sa:spire-agent \
-node
# workload entry: pods in the payments namespace with the api service account
kubectl exec -n spire spire-server-0 -- \
/opt/spire/bin/spire-server entry create \
-spiffeID spiffe://example.com/ns/payments/sa/api \
-parentID spiffe://example.com/ns/spire/sa/spire-agent \
-selector k8s:ns:payments \
-selector k8s:sa:api
Registering entries one by one doesn’t scale. The SPIRE Controller Manager generates entries from a ClusterSPIFFEID resource (a project CRD, checked against the docs, not validated in the cluster):
apiVersion: spire.spiffe.io/v1alpha1
kind: ClusterSPIFFEID
metadata:
name: payments-workloads
spec:
spiffeIDTemplate: "spiffe://example.com/ns/{{ .PodMeta.Namespace }}/sa/{{ .PodSpec.ServiceAccountName }}"
namespaceSelector:
matchLabels:
team: payments
podSelector:
matchLabels:
spiffe: enabled
The workload reaches the Workload API through a SPIFFE CSI driver volume, which mounts the agent’s socket directory without hostPath. This Deployment passed kubectl apply --dry-run=server on the test cluster:
apiVersion: apps/v1
kind: Deployment
metadata:
name: payments-api
namespace: payments
spec:
replicas: 2
selector:
matchLabels:
app: payments-api
template:
metadata:
labels:
app: payments-api
spiffe: enabled
spec:
serviceAccountName: api
containers:
- name: api
image: registry.example.com/your-org/payments-api:1.4.0
env:
- name: SPIFFE_ENDPOINT_SOCKET
value: unix:///spiffe-workload-api/spire-agent.sock
volumeMounts:
- name: spiffe-workload-api
mountPath: /spiffe-workload-api
readOnly: true
volumes:
- name: spiffe-workload-api
csi:
driver: csi.spiffe.io
readOnly: true
The application uses a SPIFFE library (such as go-spiffe) that reads SPIFFE_ENDPOINT_SOCKET, fetches the X.509-SVID, renews it before it expires, and sets up mTLS. For debugging, the agent itself shows what a process would receive:
kubectl exec -it deploy/client -- \
/opt/spire/bin/spire-agent api fetch -socketPath /run/spire/sockets/agent.sock
In service meshes, the path is different: Envoy fetches certificates over SDS, and Istio already issues SPIFFE-format identities with its own CA, and can be integrated with SPIRE when you need stronger attestation or identity outside the mesh.
When to use it (and when not to)
- Use it when many services authenticate to each other, when environments are mixed (Kubernetes, VMs, several clouds), or when zero trust with mTLS everywhere is a requirement.
- Use it to eliminate static credentials: with JWT-SVIDs or OIDC federation, workloads can authenticate to cloud providers and to Vault.
- Don’t use it as a secrets vault: SPIRE doesn’t store database passwords or API keys; it solves how the workload proves who it is in order to fetch them.
- You may not need it if everything runs in a single cluster with Istio: the mesh’s SPIFFE identity may be enough.
- Consider the operational cost: the SPIRE Server becomes a critical component, with a datastore, high availability, and CA rotation to take care of.
For users and service accounts in Kubernetes itself, see Kubernetes authentication.
Alternatives
| Option | When it makes sense |
|---|---|
| Istio’s built-in CA | SPIFFE identity inside the mesh, without running SPIRE |
| cert-manager with csi-driver-spiffe | You already use cert-manager and want simple X.509 SVIDs, without node attestation |
| Cloud workload identity (EKS Pod Identity, GKE Workload Identity, Azure Workload Identity) | Access to a single provider’s APIs |
| Projected service account tokens | Authentication within one Kubernetes cluster |
| Vault PKI | Certificate issuance with policies, but with an initial credential for Vault |
Summary
- SPIFFE is the workload identity standard; SPIRE is the reference implementation, both CNCF graduated as of November 2026
- A SPIFFE ID is a
spiffe://trust-domain/pathURI; the SVID (X.509 or JWT) is the proof - The Workload API delivers SVIDs and trust bundles with no initial secret
- SPIRE attests the node first and then the workload, using platform selectors
- SPIFFE is not a KMS: it identifies workloads, it doesn’t store data keys
-
ClusterSPIFFEIDand the CSI driver take manual registration andhostPathout of the way
A shared secret says someone knows the password; SPIFFE says who the workload is, and the platform vouches for it.