Security
Mutual TLS and workload identity
The control plane acts as a certificate authority: each workload gets a short-lived certificate (rotated automatically, by default every day) whose identity is a SPIFFE ID derived from its Kubernetes service account:
spiffe://cluster.local/ns/payments/sa/payments-api
With mutual TLS, both sides present certificates, so traffic is encrypted and each side knows exactly which workload is on the other end, independent of pod IPs.
Rolling it out without breaking things:
- Install the mesh with
PERMISSIVEmode (the default): proxies accept both mTLS and plain text, so unmeshed clients keep working. - Add workloads to the mesh; check in metrics or Kiali that traffic between them is mTLS.
- Switch namespaces to
STRICTwith aPeerAuthenticationresource, then the whole mesh.
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata: { name: default, namespace: payments }
spec:
mtls: { mode: STRICT }
Authorisation policies
AuthorizationPolicy allows or denies requests by source identity, namespace, method, path or JWT claims:
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata: { name: payments-allow-checkout, namespace: payments }
spec:
selector: { matchLabels: { app: payments-api } }
action: ALLOW
rules:
- from: [{ source: { principals: ["cluster.local/ns/checkout/sa/checkout"] } }]
to: [{ operation: { methods: ["POST"], paths: ["/charge"] } }]
Once any ALLOW policy selects a workload, everything not explicitly allowed is denied, so roll these out with care, starting in a staging namespace. Path and method rules are Layer 7, so in ambient mode they need a waypoint proxy.
A mesh complements rather than replaces Kubernetes NetworkPolicy: network policies block traffic at Layer 3/4 in the CNI even for pods outside the mesh, while mesh policies understand identities and HTTP.
Egress control: set outboundTrafficPolicy to REGISTRY_ONLY so pods can only call external hosts you've declared with ServiceEntry, and route them through an egress gateway when you need a fixed exit point for auditing.