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: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-binding-system-groupsannotations:policies.kyverno.io/title: Restrict Binding System Groupspolicies.kyverno.io/category: Security, EKS Best Practicespolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: RoleBinding, ClusterRoleBinding, RBACkyverno.io/kyverno-version: 1.8.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"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:validationFailureAction: Auditbackground: truerules:- name: restrict-anonymousmatch:any:- resources:kinds:- RoleBinding- ClusterRoleBindingvalidate:message: Binding to system:anonymous is not allowed.pattern:subjects:- name: "!system:anonymous"- name: restrict-unauthenticatedmatch:any:- resources:kinds:- RoleBinding- ClusterRoleBindingvalidate:message: Binding to system:unauthenticated is not allowed.pattern:subjects:- name: "!system:unauthenticated"- name: restrict-mastersmatch:any:- resources:kinds:- RoleBinding- ClusterRoleBindingvalidate:message: Binding to system:masters is not allowed.pattern:subjects:- name: "!system:masters"
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.