Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Authenticating between services

Each of the printer's workloads now has an identity and short-lived credentials, so the next question is how they use them when they call each other. This lesson follows the order service calling the render service, compares mutual TLS with tokens carried in each request, shows what each proves when a proxy sits in between, and ends with the rule that decides which caller may do what.

One service calls another

When you place an order, the order service asks the render service to build your book. For years, the render service accepted any request that reached its internal network address. While tracing the overnight burst of print jobs, the team finds that the nightly batch job has been calling the render service too, asking it to regenerate files it believed were missing, and then resubmitting every affected book to the print lab. Nobody intended that, and nothing stopped it.

For a long time, network location stood in for identity: a request from inside the private network was trusted. That rule admits every workload on the network, including one that is misconfigured, like the batch job, or one an attacker has taken over. Addresses also change as instances move, and an address says nothing about which service is calling.

The alternative is the one What zero trust changes described for people: authenticate and authorize every call on its own merits, wherever it comes from. Each call between services raises two questions. Does the order service know it is really talking to the render service? And does the render service know the caller is really the order service? Ordinary HTTPS answers only the first, because only the server presents a certificate.

Mutual TLS between services

In mutual TLS, the client presents a certificate as well as the server, and proves during the handshake that it holds the matching private key. With the workload certificates from Credentials for workloads, each side's identity sits in its certificate's subject alternative name:

Subject Alternative Name:
    URI:spiffe://printer.example/prod/orders
Validity:
    Not Before: Sep 24 09:00:00 2026 GMT
    Not After : Sep 24 10:00:00 2026 GMT

All domains, credentials, and tokens in these examples are fictional. The render service validates the certificate as Validating a certificate describes, with one difference. It checks the chain against the trust bundle of printer.example, the CA certificates its identity server uses to sign workload certificates, rather than against the public certificate authorities a browser trusts. Then it reads the caller's identity from the URI.

Many organizations do not build this into each service. A service mesh places a small proxy beside every service. The proxies obtain workload certificates, renew them, and wrap every call in mutual TLS, while the services themselves make ordinary calls to their local proxy. The mesh can then pass the verified caller identity to the service, or enforce rules about who may call whom.

Mutual TLS is strong, because the identity is tied to a key that never leaves its machine, and it protects every connection. Its limit is that the identity belongs to the connection. If anything between the two services ends the TLS connection and starts a new one, the far side no longer sees who called.

Tokens at the application layer

The other approach puts the caller's identity in the request itself. The order service attaches a signed token, either its workload token or an access token from an authorization server, whose audience is the render service:

POST /render-jobs HTTP/1.1
Host: render.printer.example
Authorization: Bearer demo-orders-to-render-token
Content-Type: application/json

{ "order": "book-5561" }

The render service checks the token's signature against the trust domain's published keys, confirms that its audience is the render service and that it has not expired, and reads the caller's identity from its subject. Because the token travels with the request, it survives any proxy along the way, and it can carry more than a certificate, such as the customer an order belongs to.

A plain token is a bearer token, though. A copy captured from a log or a proxy can be replayed to the render service until it expires. Short lifetimes and a single audience limit the damage, and a token can also be bound to a key the caller holds, so a copy is useless without the key: Binding a token to a key did this with a key the client creates, and Certificate-bound access tokens with the client's certificate. Many systems use both approaches together: mutual TLS for every connection, and a token for what each request is about.

When something sits in between

Some of the printer's internal calls, including the order service's, pass through a load balancer, a server that receives requests and spreads them across the running copies of a service. It ends the TLS connection and forwards each request on a new one. If the load balancer checks a client certificate, it must tell the service behind it whom it verified, and usually it adds a header:

POST /render-jobs HTTP/1.1
Host: render.internal.printer.example
X-Client-Identity: spiffe://printer.example/prod/orders

The render service may trust that header only under two conditions. The request must have arrived over an authenticated connection from the load balancer itself. And the load balancer must remove any copy of the header that arrived from outside. If either condition fails, any caller can send X-Client-Identity naming whichever service it likes. A header is only as trustworthy as whoever last wrote it.

No proxy in between

Proof
Client certificate
Render reads
prod/orders
A proxy that ends TLS
Identity lost with the connection

Caller known for one connection

TLS ends at the balancer

Proof
X-Client-Identity header
Render reads
Whatever the header names
A proxy that ends TLS
Trusted only if copies are stripped

Forged when copies get through

aud = render

Proof
Signed token for render
Render reads
The token's subject
A proxy that ends TLS
Same token arrives

Caller known for each request

A header is only as trustworthy as whoever last wrote it.

Three ways the render service learns who called. Mutual TLS identifies the caller for one connection, a header from the load balancer can be forged when incoming copies get through, and a token identifies the caller for one request and survives a proxy that ends TLS.

A further approach is being developed for requests that pass through proxies like this one, in the IETF WIMSE working group (Workload Identity in Multi System Environments), whose drafts are not yet standards. The calling workload carries a workload identity token and signs a short proof for each request with the private key behind it. The proof covers that particular request, either as a token of its own or as an HTTP message signature, a signature over chosen parts of the request such as its method, path and body. The receiver checks the proof itself, however many hops the request took, and a copied token is no use without the key. Until those drafts settle, the choice in practice is the one in the figure: identity from an authenticated connection, or a request credential the receiver validates itself.

Authorizing the caller

Authentication tells the render service who called. It still has to decide whether that caller may do what it asked. The printer writes the rule in terms of identities:

render.printer.example
  allow  spiffe://printer.example/prod/orders       POST /render-jobs
  allow  spiffe://printer.example/prod/print-batch  GET  /render-jobs/{id}/files
  deny   everything else

The batch job may download finished files, which it needs for the evening's delivery, but it may not start new renders. Its overnight calls now fail with a clear refusal, recorded with the caller's identity, instead of quietly regenerating files.

Three habits make rules like these hold up, the same ones Evaluating a policy applied to people. They deny by default, so a new caller gets nothing until someone decides it should. They name identities rather than network addresses, so they keep working as instances move. And they record refusals with the caller's identity, which is how the team would have found the batch job's calls weeks before the print lab noticed the burst.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

A load balancer ends TLS and forwards requests to the render service with an X-Client-Identity header naming the order service. What must be true before the render service trusts that header? 1 of 3

Choose one answer.

Why is "allow every caller inside the private network" not enough for the render service? 2 of 3

Choose one answer.

The order service connects with mutual TLS to a load balancer, which ends TLS and opens a new connection to the render service. What does the render service learn from its own connection? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity