An AppProject may optionally specify clusterResourceBlacklist which is a blacklisted group of cluster resources. This is often a good practice to ensure AppProjects do not allow more access than needed. This policy is a combination of two rules which enforce that all AppProjects specify clusterResourceBlacklist and that their group and kind have wildcards as values.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: appproject-clusterresourceblacklistannotations:policies.kyverno.io/title: Enforce AppProject with clusterResourceBlacklist in CEL expressionspolicies.kyverno.io/category: Argo in CELpolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.11.0policies.kyverno.io/minversion: 1.11.0kyverno.io/kubernetes-version: 1.26-1.27policies.kyverno.io/subject: AppProjectpolicies.kyverno.io/description: An AppProject may optionally specify clusterResourceBlacklist which is a blacklisted group of cluster resources. This is often a good practice to ensure AppProjects do not allow more access than needed. This policy is a combination of two rules which enforce that all AppProjects specify clusterResourceBlacklist and that their group and kind have wildcards as values.spec:validationFailureAction: Auditbackground: truerules:- name: has-wildcard-and-validate-clusterresourceblacklistmatch:any:- resources:kinds:- AppProjectoperations:- CREATE- UPDATEvalidate:cel:expressions:- expression: has(object.spec.clusterResourceBlacklist)message: AppProject must specify clusterResourceBlacklist.- expression: object.spec.clusterResourceBlacklist.all(element, element.group.contains('*') && element.kind.contains('*'))message: Wildcards must be present in group and kind for clusterResourceBlacklist.
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.