TIS0104 - Mutual TLS (mTLS) is Required for Specified Configuration Field
Mutual TLS (mTLS) is required for this field.
Mutual TLS (mTLS) is crucial for secure communication within the mesh. Ensure that mTLS is either enabled explicitly or that autoMtls is used to enforce secure communication, reducing the risk of potential vulnerabilities.
Examples
-
DestinationRulewithout mTLS EnabledapiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: no-mtls-destination-rule
namespace: example-namespace
spec:
host: "my-service.example-namespace.svc.cluster.local"
trafficPolicy:
tls:
mode: DISABLEExplanation: The
DestinationRulespecifiestls.mode: DISABLE, but mTLS is required for this field. Disabling mTLS can lead to security vulnerabilities. -
PeerAuthenticationwithout mTLSapiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: no-mtls-peer-auth
namespace: example-namespace
spec:
mtls:
mode: DISABLEExplanation: The
PeerAuthenticationconfiguration setsmtls.mode: DISABLE, but mTLS is required for secure communication. Disabling mTLS compromises the security of the mesh.
Recommendation
Remove this field or enable autoMtls.
-
Remove the Field Disabling mTLS
Remove the field that disables mTLS to allow Istio to use default security settings.
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: {} -
Enable mTLS Manually
Update the configuration to explicitly enable mTLS.
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: mtls-enabled-destination-rule
namespace: example-namespace
spec:
host: "my-service.example-namespace.svc.cluster.local"
trafficPolicy:
tls:
mode: ISTIO_MUTUAL -
Enable
autoMtlsin Mesh ConfigurationEnable
autoMtlsto automatically configure mTLS for the entire mesh.apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
name: example-istiocontrolplane
namespace: istio-system
spec:
meshConfig:
enableAutoMtls: true