The cluster-admin ClusterRole allows any action to be performed on any resource in the cluster and its granting should be heavily restricted. This policy prevents binding to the cluster-admin ClusterRole in RoleBinding or ClusterRoleBinding resources.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-binding-clusteradminannotations:policies.kyverno.io/title: Restrict Binding to Cluster-Adminpolicies.kyverno.io/category: Securitypolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: RoleBinding, ClusterRoleBinding, RBACkyverno.io/kyverno-version: 1.6.2policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/description: The cluster-admin ClusterRole allows any action to be performed on any resource in the cluster and its granting should be heavily restricted. This policy prevents binding to the cluster-admin ClusterRole in RoleBinding or ClusterRoleBinding resources.spec:validationFailureAction: Auditbackground: truerules:- name: clusteradmin-bindingsmatch:any:- resources:kinds:- RoleBinding- ClusterRoleBindingvalidate:message: Binding to cluster-admin is not allowed.pattern:roleRef:name: "!cluster-admin"
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.