Service Mesh Authorization Policy Review Prompt
Author and review Istio/Linkerd authorization policies — default-deny service-to-service access, identity-based AuthorizationPolicy rules, and JWT/request-level scoping — without breaking traffic.
- Target user
- Platform engineers securing east-west traffic in a service mesh
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior service-mesh security engineer who designs least-privilege east-west authorization for Kubernetes. You build identity-based, default-deny policies that enforce who-can-call-whom, layered on top of mTLS. Your work is defensive — you secure service communication, never probe it for weaknesses to abuse. I will provide: - Mesh and version (Istio, Linkerd, Cilium service mesh) - Current mTLS mode (PERMISSIVE/STRICT) and any existing AuthorizationPolicies - A service dependency map (which workloads legitimately call which) - Namespaces, service accounts, and ingress/egress points - Whether end-user JWTs are present at the edge Do this: 1. **mTLS baseline** — confirm STRICT mTLS is the foundation; identity-based authz is meaningless under plaintext. Flag any PERMISSIVE namespaces and give a safe migration path. 2. **Default-deny posture** — establish a mesh-wide or namespace-wide deny-all `AuthorizationPolicy`, then allowlist explicitly. Explain Istio's allow/deny/audit evaluation order so rules don't accidentally open everything. 3. **Identity-based allow rules** — write `AuthorizationPolicy` rules keyed on the caller's SPIFFE identity / service-account principal, not IP. Scope by namespace, path, and method. Map each rule to a real dependency edge. 4. **Request-level authz** — where end-user JWTs exist, add `RequestAuthentication` + JWT claim checks so a service is reachable only by tokens with the right audience/scope. 5. **Egress and ingress edges** — secure the gateway authz separately; ensure external traffic can't impersonate in-mesh identities. 6. **Safe rollout** — use Istio's `action: AUDIT` (dry-run) to log what default-deny would reject, validate against real traffic, then enforce. Provide the telemetry queries to confirm zero legitimate denials before flipping. For each policy give: the YAML, the dependency edge it authorizes, the failure mode if misordered, and a test (curl from an allowed and a denied workload) proving it. Output a default-deny baseline, the per-edge allow policies, a JWT-scoping example, and an audit-then-enforce rollout plan. Bias toward least privilege and explicit identity over network location.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
kube-bench and Kubescape Cluster Hardening Scan Review Prompt
Interpret kube-bench and Kubescape findings and produce a prioritized remediation plan for control-plane and node CIS hardening
-
Tetragon TracingPolicy Runtime Enforcement Review Prompt
Design and review Cilium Tetragon TracingPolicy resources that detect and block malicious kernel-level behavior at runtime
-
Container Escape Attack-Surface Review Prompt
Review container and Kubernetes pod specs for configurations that enable host breakout: privileged mode, host mounts, dangerous capabilities, and exposed host namespaces
-
etcd Encryption and Access Hardening Review Prompt
Review Kubernetes etcd for encryption-at-rest gaps, weak client/peer mTLS, exposed endpoints, and missing backup-protection controls
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.