mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
7562bea6db
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
25 lines
546 B
YAML
25 lines
546 B
YAML
---
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: secrets-not-from-env-vars
|
|
spec:
|
|
admission: true
|
|
background: false
|
|
rules:
|
|
- match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
name: secrets-not-from-env-vars
|
|
validate:
|
|
message: Secrets must be mounted as volumes, not as environment variables.
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- =(env):
|
|
- =(valueFrom):
|
|
X(secretKeyRef): "null"
|
|
name: '*'
|
|
validationFailureAction: Audit
|