Enabling Policy Enforcement
This task shows you how to enable Istio policy enforcement.
At install time
In the default Istio installation profile, policy enforcement is disabled. To install Istio
with policy enforcement on, use the --set global.disablePolicyChecks=false Helm install option.
Alternatively, you may install Istio using the demo profile, which enables policy checks by default.
For an existing Istio mesh
Check the status of policy enforcement for your mesh.
$ kubectl -n istio-system get cm istio -o jsonpath="{@.data.mesh}" | grep disablePolicyChecks disablePolicyChecks: trueIf policy enforcement is enabled (
disablePolicyChecksis false), no further action is needed.Edit the
istioconfigmap to enable policy checks.Execute the following command from the root Istio directory:
$ helm template install/kubernetes/helm/istio --namespace=istio-system -x templates/configmap.yaml --set global.disablePolicyChecks=false | kubectl -n istio-system replace -f - configmap "istio" replacedValidate that policy enforcement is now enabled.
$ kubectl -n istio-system get cm istio -o jsonpath="{@.data.mesh}" | grep disablePolicyChecks disablePolicyChecks: false