Allow permissive traffic through the mesh
What you’ll accomplish
Section titled “What you’ll accomplish”After completing this guide, you will have relaxed Istio’s strict authorization policies at the appropriate scope so that specific workloads or namespaces can receive traffic that would otherwise be denied by the mesh’s default deny-all model.
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with UDS Core deployed
- Confirmation that Package CR
exposeandallowrules cannot satisfy your traffic requirements
Before you begin
Section titled “Before you begin”UDS Core uses Istio’s authorization policy model to enforce a deny-all posture by default. The UDS Operator automatically generates ALLOW authorization policies based on your Package CR expose and allow declarations. Any traffic not explicitly allowed is denied.
Some workloads need traffic that falls outside this model. Common examples include:
- Applications with unusual TLS handling — workloads that perform their own mTLS or have TLS configurations that conflict with Istio’s automatic mTLS, preventing the mesh from properly identifying the traffic source
- Traffic from sources outside the mesh — requests originating from components that are not part of the Istio service mesh (e.g., infrastructure controllers, legacy services, or external systems routing directly to pods)
In these cases, you can layer additional ALLOW authorization policies on top of the operator-generated ones. Istio evaluates DENY policies first, then ALLOW policies, so your additional ALLOW rules will not override any existing DENY policies.
-
Choose and apply your AuthorizationPolicy
The options below are ordered from least permissive to most permissive. Always use the narrowest scope that meets your needs.
This is the most restrictive option. It allows any source to reach a specific port on a specific workload:
authz-policy.yaml apiVersion: security.istio.io/v1kind: AuthorizationPolicymetadata:name: permissive-ap-workload-portnamespace: <package-namespace>spec:action: ALLOWselector:matchLabels:app: my-app # Your workload selectorrules:- to:- operation:ports:- "1234"Allows any source to reach any port on a specific workload:
authz-policy.yaml apiVersion: security.istio.io/v1kind: AuthorizationPolicymetadata:name: permissive-ap-workloadnamespace: <package-namespace>spec:action: ALLOWselector:matchLabels:app: my-app # Your workload selectorrules:- {}Allows any source to reach any workload in the namespace:
authz-policy.yaml apiVersion: security.istio.io/v1kind: AuthorizationPolicymetadata:name: permissive-ap-namespacenamespace: <package-namespace>spec:action: ALLOWrules:- {} -
Apply a PeerAuthentication policy
Without a permissive
PeerAuthentication, Istio will still enforce strict mTLS and reject connections from sources that cannot present a valid mesh identity — even if theAuthorizationPolicyallows them. Match the scope of yourPeerAuthenticationto theAuthorizationPolicyyou chose in step 1.Use
portLevelMtlsto relax mTLS on only the specific port, keeping strict mTLS on all other ports:peer-auth.yaml apiVersion: security.istio.io/v1kind: PeerAuthenticationmetadata:name: permissive-panamespace: <package-namespace>spec:selector:matchLabels:app: my-app # Match the same workload as your AuthorizationPolicymtls:mode: STRICT # Keep strict mTLS as the defaultportLevelMtls:1234: # Only this port accepts non-mTLS trafficmode: PERMISSIVESet the workload-level mode to
PERMISSIVEfor all ports on the selected workload:peer-auth.yaml apiVersion: security.istio.io/v1kind: PeerAuthenticationmetadata:name: permissive-panamespace: <package-namespace>spec:selector:matchLabels:app: my-app # Match the same workload as your AuthorizationPolicymtls:mode: PERMISSIVEOmit the
selectorto apply permissive mTLS to all workloads in the namespace:peer-auth.yaml apiVersion: security.istio.io/v1kind: PeerAuthenticationmetadata:name: permissive-panamespace: <package-namespace>spec:mtls:mode: PERMISSIVESee the Istio PeerAuthentication documentation for details on scoping options.
-
Include manifests in your Zarf package and deploy
Add the
AuthorizationPolicyandPeerAuthenticationmanifests to your application’s Zarf package, then build and deploy:Terminal window uds zarf package create --confirm && uds zarf package deploy zarf-package-*.tar.zst --confirm
Verification
Section titled “Verification”After applying the policies, verify they exist:
uds zarf tools kubectl get authorizationpolicy -n <namespace>uds zarf tools kubectl get peerauthentication -n <namespace>Test that the previously-blocked traffic now flows as expected.
Troubleshooting
Section titled “Troubleshooting”Policy not taking effect
Section titled “Policy not taking effect”Symptoms: Traffic is still being denied after applying the authorization policy.
Solution:
- Verify the policy is in the correct namespace (must match the workload’s namespace)
- Check the
selectorlabels match your workload:uds zarf tools kubectl get pods -n <namespace> --show-labels - Remember that Istio evaluates
DENYpolicies beforeALLOWpolicies — if aDENYpolicy exists, yourALLOWpolicy will not override it - Ensure you have also applied a permissive
PeerAuthenticationif the traffic source cannot present a valid mesh identity
Scope too broad
Section titled “Scope too broad”Symptoms: Unintended services are now receiving traffic they shouldn’t.
Solution:
- Narrow the scope: add a
selectorto target specific workloads, or add port restrictions - Move from a namespace-scoped policy to a workload-scoped one
Related documentation
Section titled “Related documentation”- Package CR Reference
- Istio Authorization Policy Documentation
- Istio PeerAuthentication Documentation
Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: