An Ingress with no rules sends all traffic to a single default backend. The defaultBackend is conventionally a configuration option of the Ingress controller and is not specified in your Ingress resources. If none of the hosts or paths match the HTTP request in the Ingress objects, the traffic is routed to your default backend. In a multi-tenant environment, you want users to use explicit hosts, they should not be able to overwrite the global default backend service. This policy prohibits the use of the defaultBackend field.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-ingress-defaultbackendannotations:policies.kyverno.io/title: Restrict Ingress defaultBackendpolicies.kyverno.io/category: Best Practicespolicies.kyverno.io/severity: highkyverno.io/kyverno-version: 1.6.2policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/subject: Ingresspolicies.kyverno.io/description: An Ingress with no rules sends all traffic to a single default backend. The defaultBackend is conventionally a configuration option of the Ingress controller and is not specified in your Ingress resources. If none of the hosts or paths match the HTTP request in the Ingress objects, the traffic is routed to your default backend. In a multi-tenant environment, you want users to use explicit hosts, they should not be able to overwrite the global default backend service. This policy prohibits the use of the defaultBackend field.spec:validationFailureAction: Auditbackground: truerules:- name: restrict-ingress-defaultbackendmatch:any:- resources:kinds:- Ingressvalidate:message: Setting the defaultBackend field is prohibited.pattern:spec:X(defaultBackend): "null"
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.