Enable Istio mTLS for ECK Operator
By default, when istio is deployed, it's deployed with a PERMISSIVE mode that allows an istio injected pod to talk to any non-istio pod without mutual TLS.
Istio uses PeerAuthentication to enforce mTLS at the mesh level and can be applied either at the namespace level, which applies to all pods in the namespace, or at a global level when the PeerAuthentication is applied to the istio-system namespace.
- Create the
PeerAuthenticationin the{{ .Release.Namespace }}namespace (NOTE: this should be added to the package repo).If other packages deploy in the same namespace, add a selector so that the STRICT policy only applies to pods from this package.apiVersion: security.istio.io/v1beta1 kind: PeerAuthentication metadata: name: default-{package} namespace: {{ .Release.Namespace }} spec: mtls: mode: STRICT - Test the functionality of the package
- When there are issues, add an exception policy
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: name-of-expection
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
exception: label-here
mtls:
mode: PERMISSIVE
- iterate on 2) and 3)
- Add conditionals to the
PeerAuthenticationobjects so that they are only created when.Values.istio.mtlsand.Values.istio.enabledare true inside each package chart. Setistio.mtlstotrueby default inchart/values.yaml.
Edited by Micah Nagel