mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
8eb1d4c7fb
* Fix Dev setup * Update variable paths * fix testcase issue Co-authored-by: vyankatesh <vyankatesh@neualto.com>
28 lines
No EOL
801 B
YAML
28 lines
No EOL
801 B
YAML
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: select-secrets
|
|
spec:
|
|
background: false
|
|
validationFailureAction: enforce
|
|
rules:
|
|
- name: select-secrets-from-volumes
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Pod
|
|
context:
|
|
- name: volsecret
|
|
apiCall:
|
|
urlPath: "/api/v1/namespaces/{{request.object.metadata.namespace}}/secrets/{{request.object.spec.volumes[0].secret.secretName}}"
|
|
jmesPath: "metadata.labels.foo"
|
|
preconditions:
|
|
- key: "{{ request.operation }}"
|
|
operator: Equals
|
|
value: "CREATE"
|
|
validate:
|
|
message: "The Secret named {{request.object.spec.volumes[0].secret.secretName}} is restricted and may not be used."
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- image: "registry.domain.com/*" |