Certain system groups exist in Kubernetes which grant permissions that are used for certain system-level functions yet typically never appropriate for other users. This policy prevents creating bindings to some of these groups including system:anonymous, system:unauthenticated, and system:masters.
apiVersion: policies.kyverno.io/v1alpha1kind: ValidatingPolicymetadata:name: restrict-binding-system-groupsannotations:policies.kyverno.io/title: Restrict Binding System Groups in ValidatingPolicypolicies.kyverno.io/category: Security, EKS Best Practices in vpolpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: RoleBinding, ClusterRoleBinding, RBACkyverno.io/kyverno-version: 1.14.0policies.kyverno.io/minversion: 1.14.0kyverno.io/kubernetes-version: "1.30"policies.kyverno.io/description: Certain system groups exist in Kubernetes which grant permissions that are used for certain system-level functions yet typically never appropriate for other users. This policy prevents creating bindings to some of these groups including system:anonymous, system:unauthenticated, and system:masters.spec:validationActions:- Auditevaluation:background:enabled: truematchConstraints:resourceRules:- apiGroups:- rbac.authorization.k8s.ioapiVersions:- v1operations:- CREATE- UPDATEresources:- rolebindings- clusterrolebindingsvalidations:- expression: object.subjects.all(subject, subject.name != 'system:anonymous')message: Binding to system:anonymous is not allowed.- expression: object.subjects.all(subject, subject.name != 'system:unauthenticated')message: Binding to system:unauthenticated is not allowed.- expression: object.subjects.all(subject, subject.name != 'system:masters')message: Binding to system:masters is not allowed.
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.
This policy ensures that the name of the ApplicationSet is the same value provided in the project.