-
Notifications
You must be signed in to change notification settings - Fork 294
Open
Description
Hello,
I want write policy for deny deploy ConfigMap, if in some keys value, in section data, will be specific string with contain, for example "postgresql".
I wrote this policy, but it work for specific key name.
I need that check in all key values in section data.
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: disallow-credential-composite-design
spec:
rules:
- name: validate-data-design
match:
resources:
kinds:
- ConfigMap
validate:
allowExistingViolations: true
failureAction: Enforce
message: "Use of composite structures to assemble credentials is prohibited by cybersecurity policy."
foreach:
- list: request.object.data
deny:
conditions:
all:
- key: '{{ element }}'
operator: Equals
value: "*postgresql*"
Do you have any ideas?
I use Kyverno v.1.14.1
Metadata
Metadata
Assignees
Labels
No labels