Before
- Product-specific auth logic with unknown failure modes
- No shared audit contract
- Static secrets and broad credentials
- No auth latency budget
Module 8 of 8
Turn the pattern into a production-grade design with latency budgets, failure modes, audits, and rollout plans.
Start here
Before
After
JWT validation is usually fast after JWKS keys are cached. External authorization adds a network hop on the request path. That means auth service latency becomes user-facing latency. Use short timeouts, horizontal scaling, connection reuse, circuit breakers, and careful caching where policy allows it.
This cluster snippet shows the types of controls you should think about for the central auth service: timeouts, circuit breakers, outlier detection, and stable Kubernetes service discovery.
clusters:
- name: central_authz_service
type: STRICT_DNS
connect_timeout: 300ms
circuit_breakers:
thresholds:
- priority: DEFAULT
max_connections: 500
max_pending_requests: 1000
max_requests: 2000
outlier_detection:
consecutive_5xx: 5
interval: 5s
base_ejection_time: 30s
load_assignment:
cluster_name: central_authz_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: authz.platform.svc.cluster.local
port_value: 9000
Security-sensitive routes should usually fail closed: if Envoy cannot validate identity or ask the auth service, deny the request. Some read-only low-risk routes may have a documented degraded mode, but it must be explicit. Never let a timeout silently become broad access.
Real world
Production notes
Common mistakes
Security risks
Tradeoffs
Pros
Cons
Pros
Cons
Think like an engineer
Key terms
A component that must work for user requests to complete.
Deny access when the security decision cannot be made.
A control that limits calls to an unhealthy dependency before it causes broader failure.
Running a new policy path without enforcing it yet, so teams can observe decisions safely.
Exercises
Produce a review-ready design for centralized Envoy authentication and authorization.
Recap
Related resources