This resource is experimental.
Enable MeshIdentity before you apply MeshTrafficPermission.
MeshTrafficPermission defines which clients can access services inside a mesh based on their SPIFFE identities.
If no MeshTrafficPermission applies, the default behavior is to deny all requests.
You can use MeshTrafficPermission to:
deny requests from specific clients or namespaces so service owners can’t override that deny rule
allow groups of clients, such as all workloads in a namespace, to access services by default
shadow-deny traffic so you can validate a policy before you enforce it
With this policy in place, workloads labeled app: my-app reject connections from identities in the legacy-ns namespace
and from the specific test/client identity, while continuing to accept other identities in the my-mesh.us-east-2.mesh.localtrust domain.
allowWithShadowDeny: Clients that are allowed, but also logged as if they were denied. This lets you test a new policy before you enforce a deny rule.
The policy evaluates requests in this order:
If a request matches at least one deny matcher, the result is DENY.
If a request matches no deny matcher and at least one allow or allowWithShadowDeny matcher, the result is ALLOW.
If no matcher applies, the result is DENY.
See the Examples tab for ready-to-apply policies that deny namespace-wide traffic,
allow namespace-wide traffic, and override a mesh-wide allow rule on a specific service port.
See the Configuration reference tab for the complete schema.