One way sidecar injection in an Istio service mesh may be accomplished is by defining an annotation at the Pod level. Pods not receiving a sidecar cannot participate in the mesh thereby reducing visibility. This policy ensures that Pods cannot set the annotation `sidecar.istio.io/inject` to a value of `false`.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: prevent-disabling-injection-podsannotations:policies.kyverno.io/title: Prevent Disabling Istio Sidecar Injectionpolicies.kyverno.io/category: Istiopolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.8.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.24"policies.kyverno.io/subject: Podpolicies.kyverno.io/description: One way sidecar injection in an Istio service mesh may be accomplished is by defining an annotation at the Pod level. Pods not receiving a sidecar cannot participate in the mesh thereby reducing visibility. This policy ensures that Pods cannot set the annotation `sidecar.istio.io/inject` to a value of `false`.spec:validationFailureAction: Auditbackground: truerules:- name: prohibit-inject-annotationmatch:any:- resources:kinds:- Podvalidate:message: Pods may not disable sidecar injection by setting the annotation sidecar.istio.io/inject to a value of false.pattern:metadata:"=(annotations)":"=(sidecar.istio.io/inject)": "!false"
This policy prevents the use of the default project in an Application.
Services of type LoadBalancer when deployed inside AWS have support for transport encryption if it is enabled via an annotation. This policy requires that Services of type LoadBalancer contain the annotation service.beta.kubernetes.io/aws-load-balancer-ssl-cert with some value.
This policy prevents updates to the project field after an Application is created.