Ingress resources which name a host name that is not present in the TLS section can produce ingress routing failures as a TLS certificate may not correspond to the destination host. This policy ensures that the host name in an Ingress rule is also found in the list of TLS hosts.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: ingress-host-match-tlsannotations:policies.kyverno.io/title: Ingress Host Match TLSpolicies.kyverno.io/category: Otherpolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.6.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: 1.20, 1.21policies.kyverno.io/subject: Ingresspolicies.kyverno.io/description: Ingress resources which name a host name that is not present in the TLS section can produce ingress routing failures as a TLS certificate may not correspond to the destination host. This policy ensures that the host name in an Ingress rule is also found in the list of TLS hosts.spec:background: falsevalidationFailureAction: Auditrules:- name: host-match-tlsmatch:any:- resources:kinds:- Ingresspreconditions:all:- key: "{{request.operation || 'BACKGROUND'}}"operator: AnyInvalue:- CREATE- UPDATEvalidate:message: The host(s) in spec.rules[].host must match those in spec.tls[].hosts[].deny:conditions:all:- key: "{{ (request.object.spec.rules[].host || `[]`) | sort(@) }}"operator: AnyNotInvalue: "{{ (request.object.spec.tls[].hosts[] || `[]`) | sort(@) }}"
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.