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 performs some best practices validation on Application fields. Path or chart must be specified but never both. And destination.name or destination.server must be specified but never both.
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.