Identity-aware policy: authentication is evidence, authorization is a decision
Connect workload credentials, peer validation, mesh authorization, application permissions, and policy-enforcement placement.
On this page
The question for today
What you’ll understand
- Distinguish a validated workload identity from permission to perform an operation.
- Identify where Layer 4 and Layer 7 authorization can be enforced.
- Calculate conditional policy outcomes and credential-validity headroom without assuming a complete availability guarantee.
A certificate can establish which workload is presenting a connection, but it does not decide whether that workload may read a particular customer's record. Identity-aware traffic policy combines cryptographic validation with explicitly scoped authorization. The decision must be enforced on a path that actually sees the relevant identity and request attributes, including traffic that might otherwise bypass the intended intermediary.
Obtain and validate a workload identity
SPIFFE represents a workload identity through a SPIFFE ID and a verifiable identity document. For X.509-SVID authentication, validation includes the appropriate trust domain and certificate-path requirements, the identity encoded in the certificate, and the TLS peer's possession of its private key through the handshake. The Workload API supplies identity material and trust information according to the implementation's attestation and entitlement rules. Reaching a local API socket is not permission to arbitrarily claim every identity; caller identification and issued-identity authorization remain essential parts of the provider.
A workload identity can represent a service account or another configured security principal rather than a unique application user. Several replicas may legitimately share the same principal. Mutual TLS authenticates channel peers and protects transport; it does not automatically validate end-user permissions or prove application readiness. Credential rotation also requires clients to receive and use fresh identity material and trust bundles. A cached credential must still meet its validity and trust requirements when the chosen authentication mechanism evaluates it.
Enforce only attributes the component can establish
A Layer 4 policy can use authenticated peer identity and transport attributes without understanding an HTTP method or path. A Layer 7 policy requires an HTTP-aware enforcement point, such as a sidecar HTTP filter or an appropriate waypoint in the chosen architecture. In the documented Istio ambient variant, source type and waypoint enrollment affect whether traffic reaches that Layer 7 component. Define policy coverage for direct pod access, service access, gateways, out-of-mesh clients, and excluded ports rather than assuming one label makes every path equivalent.
Headers containing a claimed user or certificate identity are not automatically trustworthy. An application must know which trusted component supplied them, how untrusted values were removed or replaced, and whether a bypass path can reach the application directly. Mesh authorization should also be tested independently from application authorization: a valid service principal might be allowed to call an API while still lacking permission for a particular account. Kubernetes readiness and health probes are operational signals, not substitutes for either permission check, even when they traverse authenticated transport.
Test negative cases at the correct boundary
Create explicit cases for an unknown trust domain, expired credential, valid but disallowed workload, wrong HTTP operation, and allowed mesh identity with denied application permission. Observe which component rejects each request and whether logs preserve the validated principal without exposing private keys. Check failure behavior when external authorization or credential delivery is unavailable. A permissive fallback and a fail-closed rule are different policies; document the configured choice instead of assuming every mesh responds identically. Successful requests alone cannot demonstrate that disallowed paths are blocked.
The probability lab illustrates a hypothetical workload mixture, not cryptographic validation. Reset, set p=0.25 and n=20, predict five policy-denied requests on average, then Play or Step. Separately Reset, set p=0.50 and n=20, predict ten, then Play or Step. The independent binomial model merely counts stipulated request labels; it does not evaluate credentials or authorization. Use it to distinguish aggregate denial-rate telemetry from proof that each required negative test is enforced. A low denial fraction may mean good legitimate traffic, missing coverage, or incorrect acceptance.
Work it through
Count decisions at separate gates
Among 100 synthetic requests, 80 pass peer authentication. Of those 80, exactly 50 pass mesh policy. Of those 50, exactly 40 pass application permission. Treat these as measured conditional counts.
Peer authentication rejects 100−80=20 requests. The mesh-policy gate rejects 80−50=30 more requests among authenticated peers.
The application rejects another 50−40=10 requests. Final accepted count is 40, while total rejected count is 20+30+10=60.
No independence assumption was used: each count is conditional on reaching its gate. Reporting eighty authenticated requests as eighty authorized operations would merge distinct decisions.
A valid workload identity is necessary in this policy but insufficient. Exactly forty of the hundred requests pass the complete specified conjunction.
The living notebook
Explore the model
Interactive lab · probability
A denial rate is not a policy proof
Reset, set p=0.25 and n=20, predict mean denied count 5, then Play or Step. Separately Reset, set p=0.50 and n=20, predict mean 10, then Play or Step. The exact independent binomial bars count hypothetical labels; they do not authenticate a peer or execute authorization policy.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forAggregate outcomes need explicit per-path negative tests to establish enforcement.
Pause & reason
Check your understanding
Your turn
Try it yourself
A credential's notAfter time is 12:00, current time is 11:45, and the conservative margin is one minute. Calculate expiry headroom and explain why it is not a fourteen-minute service-availability promise.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Subtract current time and the margin, then list independent requirements.
Compare with the solution
The nominal remaining interval is fifteen minutes; subtracting one minute leaves fourteen minutes of expiry headroom. Chain trust, notBefore validity, authorization, endpoint reachability, successful handshakes, and process state remain separate. Credential delivery could fail, and existing connections can follow different lifetime rules, so the arithmetic alone does not guarantee service.
Keep the idea
Take it with you
- Validated identity and authorization answer different questions.
- A policy must execute on a path that can establish its required attributes.
- Credential headroom and aggregate denial counts do not replace enforcement tests.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.