Wildcards ('*') in verbs grants all access to the resources referenced by it and does not follow the principal of least privilege. As much as possible, avoid such open verbs unless scoped to perhaps a custom API group. This policy blocks any Role or ClusterRole that contains a wildcard entry in the verbs list found in any rule.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-wildcard-verbsannotations:policies.kyverno.io/title: Restrict Wildcard in Verbspolicies.kyverno.io/category: Security, EKS Best Practicespolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Role, ClusterRole, RBACkyverno.io/kyverno-version: 1.6.2policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/description: Wildcards ('*') in verbs grants all access to the resources referenced by it and does not follow the principal of least privilege. As much as possible, avoid such open verbs unless scoped to perhaps a custom API group. This policy blocks any Role or ClusterRole that contains a wildcard entry in the verbs list found in any rule.spec:validationFailureAction: Auditbackground: truerules:- name: wildcard-verbsmatch:any:- resources:kinds:- Role- ClusterRolevalidate:message: Use of a wildcard ('*') in any verbs is forbidden.deny:conditions:any:- key: "{{ contains(to_array(request.object.rules[].verbs[]), '*') }}"operator: Equalsvalue: true
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.