Interview › Istio & Service Mesh
How do you test an AuthorizationPolicy before enforcing it (dry-run)?
Istio & Service Mesh · Advanced level
Answer
I test AuthorizationPolicy using dry-run where supported, narrow selectors, staging namespaces, synthetic requests, and access-log review before enforcing. Dry-run lets me see what would be denied without actually breaking production traffic.
Technical explanation
Dry-run is especially useful when introducing DENY policies or default-deny posture.
I also run positive and negative test cases: allowed caller succeeds, unauthorized caller fails, wrong method fails, wrong JWT claim fails.
After enforcement, I monitor 403 responses and RBAC response flags closely.
Hands-on example
Dry-run annotation example:
metadata:
annotations:
istio.io/dry-run: 'true'Then send test traffic and inspect proxy metrics/logs for authorization decision signals.
PromQL idea:
sum(rate(istio_requests_total{response_code='403'}[5m])) by (source_workload,destination_workload)
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Istio & Service Mesh interview questions
- How do you observe and reduce the error rate of a specific service via the mesh?
- What is the difference between L4 and L7 policy enforcement in the mesh?
- How does Istio interact with NetworkPolicies — do you need both?
- How do you handle gradual migration of services into mTLS STRICT mode?
- How do you integrate an external authorization service with Istio?
- How would you implement rate limiting in Istio (local and global)?
- How do you ensure the sidecar is ready before the app starts taking traffic?
- What is SNI-based routing, and how does the ingress gateway use it?