Part 4 of 9 · 2 min read
Service to service
Calls inside the network need trust too.
BM asks how one service should authenticate to another, and lists options.
| Option | How it works | Main limits |
|---|---|---|
| Trust everything inside the network | Calls from inside the perimeter are assumed safe | An attacker who gets in can read, change or fake traffic (a man-in-the-middle attack). BM calls it the most common model and worries that it is often unconscious |
| HTTP Basic over HTTPS | Username and password in a header | Must use HTTPS or the password is visible. Certificates must be managed. TLS traffic cannot be cached by reverse proxies unless TLS ends at a load balancer. Only proves the caller knows the password |
| SAML or OpenID Connect | Use the existing identity system, with a service account per service | Needs secure credential storage. Clients can be hard to code (SAML) or poorly supported (OpenID Connect) |
| Client certificates | Each client has a certificate checked through TLS | Strong guarantees, but certificate management is heavy and diagnosing rejected certificates is slow. Used for very sensitive data or networks you do not control |
| HMAC signing | Hash the request body with a shared private key and send the hash | Detects tampering and never sends the key. Needs a shared secret, is a pattern not a standard, and body stays visible. BM points to Amazon S3's approach and to JSON web tokens, and warns that one missed boolean check in a token library can break all authentication |
| API keys | A key identifies the caller and limits what it may do, including rate limits | Keys must be issued, stored and managed centrally |
BM's advice on service accounts: keep each narrow. Give each microservice its own credentials, so that if one leaks, only that set needs revoking.
Check yourself: 1. Why is "trust everything inside" risky? 2. Why give each service its own credentials? 3. What does HMAC prove, and what does it not hide?