TIS0501 - Namespace-Wide DestinationRule Enabling mTLS is Missing
A DestinationRule enabling namespace-wide mTLS is missing.
DestinationRule to Enforce mTLSTo secure communication between services within a namespace, add a namespace-wide DestinationRule that sets the tls traffic policy to ISTIO_MUTUAL. This ensures all services within the namespace communicate securely.
Examples
-
No Namespace-Wide
DestinationRuleConfigured# No namespace-wide `DestinationRule` present in the namespace configurationExplanation: Without a namespace-wide
DestinationRulespecifying mTLS, secure communication between services within the namespace is not enforced. This may result in services communicating in plaintext, which compromises security within the namespace.
Recommendation
Add a DestinationRule with a *.[namespace].svc.cluster.local host and ISTIO_MUTUAL as the tls traffic policy mode to enforce mTLS for services within the namespace.
-
Add Namespace-Wide
DestinationRuleto Enforce mTLSCreate a
DestinationRulein the target namespace that applies to all services within that namespace, enablingISTIO_MUTUALmode for mTLS.apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: namespace-wide-mtls
namespace: example-namespace
spec:
host: "*.example-namespace.svc.cluster.local"
trafficPolicy:
tls:
mode: ISTIO_MUTUALExplanation: This
DestinationRuleenforces mTLS for all services within theexample-namespaceby applying the rule to any host ending in.example-namespace.svc.cluster.local. Setting thetlsmode toISTIO_MUTUALensures that all services use mutual TLS for secure communication within the namespace.