1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/test/conformance/chainsaw/cli/apply/apply-on-cluster-scoped-resources/policy.yaml
Mariam Fahmy 734f1df059
fix: check the resource namespace (#10738)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-07-26 21:45:54 +08:00

20 lines
No EOL
476 B
YAML

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: restrict-binding-system-groups
spec:
validationFailureAction: Enforce
background: true
rules:
- name: restrict-masters
match:
any:
- resources:
kinds:
- RoleBinding
- ClusterRoleBinding
validate:
message: "Binding to system:masters is not allowed."
pattern:
roleRef:
name: "!system:masters"