Clusters not initially installed with Kubernetes 1.22 may be vulnerable to an issue defined in CVE-2021-25740 which could enable users to send network traffic to locations they would otherwise not have access to via a confused deputy attack. This was due to the system:aggregate-to-edit ClusterRole having edit permission of Endpoints. This policy, intended to run in background mode, checks if your cluster is vulnerable to CVE-2021-25740 by ensuring the system:aggregate-to-edit ClusterRole does not have the edit permission of Endpoints.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-edit-for-endpointsannotations:policies.kyverno.io/title: Restrict Edit for Endpoints CVE-2021-25740policies.kyverno.io/category: Securitypolicies.kyverno.io/severity: lowpolicies.kyverno.io/subject: ClusterRolekyverno.io/kyverno-version: 1.9.0kyverno.io/kubernetes-version: "1.24"policies.kyverno.io/description: Clusters not initially installed with Kubernetes 1.22 may be vulnerable to an issue defined in CVE-2021-25740 which could enable users to send network traffic to locations they would otherwise not have access to via a confused deputy attack. This was due to the system:aggregate-to-edit ClusterRole having edit permission of Endpoints. This policy, intended to run in background mode, checks if your cluster is vulnerable to CVE-2021-25740 by ensuring the system:aggregate-to-edit ClusterRole does not have the edit permission of Endpoints.spec:validationFailureAction: Auditbackground: truerules:- name: system-aggregate-to-edit-checkmatch:any:- resources:kinds:- ClusterRolenames:- system:aggregate-to-editvalidate:message: This cluster may still be vulnerable to CVE-2021-25740. The system:aggregate-to-edit ClusterRole should not have edit permission over Endpoints.deny:conditions:all:- key: editoperator: AnyInvalue: "{{ request.object.rules[?resources[?contains(@,'endpoints')]].verbs[] }}"
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.