Articles

What Is SPIFFE? Workload Identity for Services Explained

SPIFFE is an open standard that gives every service a cryptographic identity without static secrets. How SPIFFE IDs, SVIDs, and SPIRE work together.

Chisato Chisato · · 6 min read
A glowing blue mesh of connected network nodes

SPIFFE (the Secure Production Identity Framework For Everyone) is an open standard for giving software workloads — services, containers, batch jobs, functions — a verifiable cryptographic identity. Instead of handing each service an API key or password and hoping it stays secret, SPIFFE lets a workload prove who it is using short-lived certificates or tokens that are issued automatically, rotated constantly, and tied to attributes of where and how the workload is running.

The problem SPIFFE solves

Humans have well-understood identity: a username, a password or passkey, maybe a second factor. Services historically got something much cruder. A typical backend talks to a database with a connection string containing a password, calls another internal API with a shared token, and reaches a cloud API with a long-lived access key. Those credentials end up in environment variables, config files, CI logs, and occasionally public repositories.

Secrets management tools reduce the blast radius by storing and rotating those values centrally, but they leave a bootstrapping question open: how does a service authenticate to the secrets manager in the first place? Something has to be the “secret zero.”

SPIFFE answers that question differently. A workload doesn’t present a secret it was given; it is attested — the platform inspects facts about the running process (which node it’s on, which Kubernetes service account it uses, which container image it was started from) and, if those facts match a registered policy, issues it an identity document. No pre-shared credential ever needs to be distributed.

The three building blocks

SPIFFE is deliberately small. The specification defines three things.

SPIFFE ID

A SPIFFE ID is a URI that names a workload:

spiffe://example.org/billing/api

The part after spiffe:// is the trust domain — the administrative boundary that issues identities, usually one per organization or environment. The path identifies the specific workload. The format is intentionally free-form; teams commonly encode namespace and service name, but the standard doesn’t require any particular layout.

SVID

A SPIFFE Verifiable Identity Document (SVID) is the credential that carries a SPIFFE ID and proves it. There are two formats:

  • X.509-SVID — an ordinary X.509 certificate with the SPIFFE ID placed in the URI Subject Alternative Name field. Because it’s a standard certificate, it plugs straight into TLS and especially into mutual TLS, where both sides of a connection present certificates.
  • JWT-SVID — a signed JSON Web Token whose sub claim is the SPIFFE ID. Useful when traffic passes through a load balancer or proxy that terminates TLS, so certificate identity wouldn’t survive end to end. You can inspect one with our JWT decoder.

X.509-SVIDs are generally preferred because they can’t be replayed by an eavesdropper the way a bearer token can.

Workload API

The Workload API is a local endpoint — typically a Unix domain socket — that a workload calls to fetch its current SVIDs and the trust bundle it needs to verify other workloads. The workload doesn’t authenticate to this API with a credential. The agent serving the socket identifies the caller by inspecting the calling process through the operating system, then decides which identity it is entitled to.

The Workload API also streams updates, so when an SVID nears expiry the workload receives a fresh one automatically. Lifetimes measured in minutes to hours are normal.

SPIFFE vs SPIRE

SPIFFE is the specification. SPIRE (the SPIFFE Runtime Environment) is the reference implementation, and the two names are often used interchangeably in conversation even though they are different things.

SPIFFESPIRE
What it isA set of specificationsSoftware that implements them
DefinesID format, SVID formats, Workload API, federationServer, agents, attestation plugins
Can you replace it?It’s the interface other tools targetYes — other systems can issue SVIDs too
Runs whereNowhere; it’s a documentServer in a control plane, agent on each node

A SPIRE deployment has two components:

  1. SPIRE Server — acts as the signing authority for the trust domain. It holds registration entries that map workload attributes (“selectors”) to SPIFFE IDs.
  2. SPIRE Agent — runs on every node. It first proves the node’s own identity to the server (node attestation, using things like a cloud provider’s instance identity document or a TPM). Then, whenever a local process calls the Workload API, the agent performs workload attestation and hands back the matching SVID.

Other projects implement parts of SPIFFE as well. Several service meshes issue SPIFFE-formatted identities to their sidecars, which is why you may already be using SPIFFE IDs without having installed SPIRE.

How attestation works in practice

Consider a Kubernetes cluster. An operator creates a registration entry along these lines:

  • SPIFFE ID: spiffe://example.org/ns/payments/sa/ledger
  • Selectors: Kubernetes namespace payments, service account ledger
  • Parent: the agents running on the cluster’s nodes

When a pod starts and its process connects to the agent’s socket, the agent learns the process ID from the kernel, asks the kubelet which pod and container that process belongs to, and checks the namespace and service account against the selectors. If they match, the pod receives an X.509-SVID for spiffe://example.org/ns/payments/sa/ledger.

Nothing in the pod spec contained a secret. A compromised container image deployed under a different service account would simply receive a different identity — or none — which is the property zero trust security depends on: identity is derived from verifiable facts, not network location.

What you do with an identity

An identity on its own authorizes nothing. SPIFFE answers “who is calling?”; your authorization layer still answers “is that caller allowed to do this?” Common patterns:

  • Service-to-service mTLS. Each service presents its X.509-SVID and verifies the peer’s against the trust bundle. Authorization rules then reference SPIFFE IDs: the ledger service accepts calls only from spiffe://example.org/ns/payments/sa/checkout.
  • Credential exchange. Cloud providers and secret stores can be configured to trust a SPIFFE trust domain, letting a workload swap its JWT-SVID for short-lived cloud credentials instead of storing a static access key.
  • Database authentication. Databases that support client-certificate authentication can accept X.509-SVIDs directly, removing passwords from connection strings.

This mirrors the split in Kubernetes itself, where RBAC decides what an authenticated subject may do but relies on something else to establish who the subject is.

Federation across trust domains

Organizations rarely live in a single trust domain. Staging and production may be separate, and two companies may need their services to call each other. SPIFFE federation lets trust domains exchange trust bundles — the sets of public keys used to verify each other’s SVIDs — through a defined bundle endpoint. Once federated, a workload in one domain can verify an SVID from the other without either side sharing a signing key.

Trade-offs to weigh

SPIFFE is not free to adopt:

  • New critical infrastructure. The SPIRE Server becomes a dependency for every workload that needs a fresh identity. It needs high availability, careful key storage, and monitoring.
  • Registration hygiene. Overly broad selectors (“anything on this node”) quietly hand out identities to workloads that shouldn’t have them. Selectors deserve the same review as firewall rules.
  • Application support. Applications must either read the Workload API themselves, use a helper that writes certificates to disk, or sit behind a proxy that handles mTLS for them.

For a handful of services, a well-run secrets manager may be enough. SPIFFE pays off as the number of services, clusters, and environments grows and static credentials become impossible to track.

The takeaway

SPIFFE gives services the kind of identity humans have had for years: a stable name, a verifiable credential, and automatic rotation. A SPIFFE ID names the workload, an SVID proves it as an X.509 certificate or JWT, and the Workload API delivers that proof locally after attestation — with no secret to bootstrap. SPIRE is the most common way to run it, and service meshes often speak it already. Pair it with mTLS and explicit authorization rules, keep registration selectors narrow, and you remove an entire class of leaked-credential incidents.

Chisato Chisato · · 4 min read

What Is SCIM? Automated User Provisioning Explained

SCIM is a standard protocol for automatically creating, updating, and deactivating user accounts across apps as an identity provider's directory changes.

#Security #Authentication #Cloud
Chisato Chisato · · 4 min read

Kubernetes Network Policies Explained

Kubernetes NetworkPolicies control which pods can talk to which, at the network layer. Here's how they work and why pods are open by default.

#Kubernetes #Cloud #DevOps