mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
* new samples; updates * typos * add policy to restrict LoadBalancer * correct sample numbering * fix typos * add EnsurePodProbesDifferent * add DisallowSecrets policy * add AddDefaultLabels policy * typo
22 lines
No EOL
506 B
YAML
22 lines
No EOL
506 B
YAML
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: secrets-not-from-env-vars
|
|
spec:
|
|
background: false
|
|
validationFailureAction: audit
|
|
rules:
|
|
- name: secrets-not-from-env-vars
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Pod
|
|
validate:
|
|
message: "Secrets must be mounted as volumes, not as environment variables."
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- name: "*"
|
|
=(env):
|
|
- =(valueFrom):
|
|
X(secretKeyRef): "null" |