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.

In one sentence: the starter fetches your workload’s SPIFFE certificate from the local agent, keeps it rotated, and plugs it into Spring Boot’s SSL bundles, HTTP clients, Spring Security and Actuator.

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 spiffe://example.org/ns/shop/sa/orders.

Trust domain

The part after spiffe://: one identity authority, such as example.org.

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 sub is the SPIFFE ID. It is used where TLS ends before the service, such as behind a proxy.

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, RestClient and WebClient.

  • Authorizes callers by SPIFFE ID, with an allow-list property, a @SpiffePeer controller 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 spiffe health indicator DOWN before the certificate expires.

How it works

How a Spring Boot application gets its SPIFFE identity from SPIRE or IDIRA SWA through the starter
  1. 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.

  2. It turns them into a rotating spiffe SSL bundle that Spring Boot’s servers and HTTP clients use like any other bundle.

  3. It fetches JWT-SVIDs from the agent on demand and caches them until they approach expiry.

  4. 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 (swa-agent)

The standard SPIFFE Workload API over a unix socket.

IDIRA SWA, agentless

The optional spiffe-spring-boot-swa-agentless module exchanges the pod’s GCP metadata ID token for SVIDs through swa-server’s IdentityExchange gRPC API.

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.

Next steps

  • Getting started: secure your first app in five minutes.

  • Features: everything the starter configures, with code.

  • FAQ: hostname verification, rotation, troubleshooting.

SPIFFE Spring Boot is an independent open-source project under the Apache License 2.0. It is not affiliated with or endorsed by the SPIFFE project, the CNCF, or Broadcom (Spring). SPIFFE, SPIRE, Spring and Spring Boot are trademarks of their respective owners.

GitHub · Issues · Sample