SPIFFE Spring Boot gives a Spring Boot application a cryptographic identity, and mutual TLS built on it, without any identity code in the application. You add one dependency, deploy the app next to a SPIFFE agent, and the starter does the rest.
The problem it solves
Services that call each other need to answer two questions: who is calling me? and am I really talking to the service I think I am?
The usual answers all hurt:
-
Shared secrets and API keys have to be stored, distributed and rotated, and they leak.
-
Hand-managed TLS certificates expire at the worst moment, and every team wires keystores differently.
-
Network rules ("anything from this subnet is trusted") break down in Kubernetes, across clouds, and under zero-trust policies.
SPIFFE fixes this at the platform level: a node agent attests each workload and hands it a short-lived identity document, with no secret to provision. SPIFFE Spring Boot connects that platform identity to Spring Boot, so applications get it for free.
SPIFFE in one minute
| Term | What it means |
|---|---|
SPIFFE ID |
A URI that names a workload, such as |
Trust domain |
The part after |
X.509-SVID |
A short-lived X.509 certificate that carries the SPIFFE ID. It is used for mutual TLS. |
JWT-SVID |
A short-lived signed JWT whose |
Trust bundle |
The CA certificates (or JWT signing keys) used to verify SVIDs from a trust domain. |
Workload API |
A local gRPC API, usually on a unix socket, from which the agent streams SVIDs and bundles to the workload. |
What the starter does
-
Finds the agent on its own: an explicit setting,
SPIFFE_ENDPOINT_SOCKET, or the well-known SPIRE and SWA socket paths. -
Keeps the identity fresh: it streams the X.509-SVID and trust bundles and applies every rotation without a restart.
-
Turns on mTLS through a standard Spring Boot SSL bundle called
spiffe, for Tomcat, Reactor Netty,RestClientandWebClient. -
Authorizes callers by SPIFFE ID, with an allow-list property, a
@SpiffePeercontroller argument, or Spring Security authorization managers. -
Handles JWT-SVIDs both ways: it adds them to outbound calls and validates inbound ones through Spring Security’s resource server.
-
Reports its health through Actuator, so a stalled rotation turns the
spiffehealth indicator DOWN before the certificate expires.
How it works
-
With a node agent (SPIRE agent or IDIRA
swa-agent), the starter opens the agent’s Workload API socket and streams the workload’s X.509-SVID and trust bundles. -
It turns them into a rotating
spiffeSSL bundle that Spring Boot’s servers and HTTP clients use like any other bundle. -
It fetches JWT-SVIDs from the agent on demand and caches them until they approach expiry.
-
With no agent at all (IDIRA SWA agentless, for example on a shared GKE cluster), an optional module exchanges the pod’s platform token for SVIDs. Everything above it works the same way.
Your code never touches a certificate, a key or a token. In the simplest case it only sets server.ssl.bundle=spiffe.
Supported backends
| Backend | How the app gets its identity |
|---|---|
SPIRE agent |
The standard SPIFFE Workload API over a unix socket. |
IDIRA Secure Workload Access ( |
The standard SPIFFE Workload API over a unix socket. |
IDIRA SWA, agentless |
The optional |
Any other agent that implements the SPIFFE Workload API works as well. See Backends for the details of each one.
Requirements
-
Java 21 or later
-
Spring Boot 4.2.0 (the 4.2 line)
-
A SPIFFE Workload API agent next to the app, or an IDIRA SWA server for agentless mode
What it is not
-
It is not an identity provider. It does not run SPIRE or SWA; it consumes the identity they issue.
-
It does not replace your authorization rules. It tells you reliably who is calling; you decide what they may do.
-
It does not change apps that run without an agent. If no Workload API socket is found and agentless mode is off, nothing is configured and the app starts exactly as before.