TIS0207 - PeerAuthentication with STRICT Mode Found, Should Be PERMISSIVE
A PeerAuthentication with mTLS set to STRICT mode was found, but it should be set to PERMISSIVE.
PeerAuthentication and Client SettingsTo prevent communication failures, ensure that PeerAuthentication is set to PERMISSIVE mode if clients may use plaintext connections, or update the DestinationRule to enforce mTLS. This ensures compatibility and successful communication between services.
Examples
-
PeerAuthenticationConfigured with STRICT ModeapiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: strict-peer-auth
namespace: example-namespace
spec:
mtls:
mode: STRICTExplanation: The
PeerAuthenticationis configured withSTRICTmode, which enforces mTLS for all communication in the namespace. However, clients may initiate plaintext communication that the workloads cannot accept, leading to failures in connectivity.
Recommendation
Change the PeerAuthentication to PERMISSIVE mode or update the DestinationRule to initiate communications using mTLS.
-
Change
PeerAuthenticationto PERMISSIVE ModeUpdate the
PeerAuthenticationto allow both mTLS and plaintext communication, ensuring compatibility with clients that do not use mTLS.apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: permissive-peer-auth
namespace: example-namespace
spec:
mtls:
mode: PERMISSIVE -
Update
DestinationRuleto Initiate mTLS CommunicationAlternatively, update the
DestinationRuleto ensure that clients initiate communication using mTLS, making it compatible with theSTRICTmode.apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: mtls-destination-rule
namespace: example-namespace
spec:
host: "my-service.example-namespace.svc.cluster.local"
trafficPolicy:
tls:
mode: ISTIO_MUTUAL