Strict mTLS requires that mutual TLS be enabled across the entire service mesh, which can be set using a PeerAuthentication resource on a per-Namespace basis and, if set on the `istio-system` Namespace could disable it across the entire mesh. Disabling mTLS can reduce the security for traffic within that portion of the mesh and should be controlled. This policy prevents disabling strict mTLS in a PeerAuthentication resource by requiring the `mode` be set to either `UNSET` or `STRICT`.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: enforce-strict-mtlsannotations:policies.kyverno.io/title: Enforce Istio Strict mTLSpolicies.kyverno.io/category: Istiopolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: PeerAuthenticationkyverno.io/kyverno-version: 1.8.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.24"policies.kyverno.io/description: Strict mTLS requires that mutual TLS be enabled across the entire service mesh, which can be set using a PeerAuthentication resource on a per-Namespace basis and, if set on the `istio-system` Namespace could disable it across the entire mesh. Disabling mTLS can reduce the security for traffic within that portion of the mesh and should be controlled. This policy prevents disabling strict mTLS in a PeerAuthentication resource by requiring the `mode` be set to either `UNSET` or `STRICT`.spec:validationFailureAction: Auditbackground: truerules:- name: validate-mtlsmatch:any:- resources:kinds:- PeerAuthenticationvalidate:message: PeerAuthentication resources may only set UNSET or STRICT for the mode.pattern:"=(spec)":"=(mtls)":"=(mode)": UNSET | STRICT
This policy performs some best practices validation on Application fields. Path or chart must be specified but never both. And destination.name or destination.server must be specified but never both.
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.