GitHub advisory · Go
Istio: ztunnel does not enforce AuthorizationPolicy trust domain restrictions
Description
In ambient mode, istiod does not correctly convert the trustDomains and notTrustDomains source fields, or the source.trustDomain condition, of an AuthorizationPolicy into the policy that ztunnel enforces. As a result, a DENY rule that relies on them can have no effect, and an ALLOW rule that combines them with other source fields can admit callers that it is meant to exclude. Sidecars and waypoint proxies enforce these restrictions.
handleRule in pilot/pkg/serviceregistry/ambient/authorization.go converts AuthorizationPolicy rules for ztunnel. It builds each source match from IP blocks, namespaces, service accounts and principals. It never reads trustDomains or notTrustDomains. The intended behavior is to match them against the trust domain of the peer identity, as the sidecar and waypoint conversion does.
The effect depends on the rest of the rule:
| Policy | Behavior in ztunnel |
|--------|---------------------|
| DENY, source sets only trust domain fields | The source becomes an empty match, which ztunnel never matches. If the rule has no other source, the whole rule never matches, including any to or when restrictions in it. |
| DENY, trust domain fields combined with another field, such as namespaces | Only the other field is enforced. The rule denies more traffic than requested. |
| ALLOW, source sets only trust domain fields | The source never matches. Traffic that should be allowed through it is not. |
| ALLOW, trust domain fields combined with another field | Only the other field is enforced. Callers outside the requested trust domains, or in excluded ones, can be admitted. |
For these two fields, the policy status does not report a problem and can show that the policy is attached to ztunnel. For a DENY rule whose sources set only trust domain fields and that has no to section,…
Manual fix · Go
go get istio.io/istio@v0.0.0-20261202191158-a07a301441fcSources