Secrets used as environment variables containing sensitive information may, if not carefully controlled, be printed in log output which could be visible to unauthorized people and captured in forwarding applications. This policy disallows using Secrets as environment variables.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: secrets-not-from-env-varsannotations:policies.kyverno.io/title: Disallow Secrets from Env Varspolicies.kyverno.io/category: Sample, EKS Best Practicespolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Pod, Secretkyverno.io/kyverno-version: 1.6.0policies.kyverno.io/description: Secrets used as environment variables containing sensitive information may, if not carefully controlled, be printed in log output which could be visible to unauthorized people and captured in forwarding applications. This policy disallows using Secrets as environment variables.spec:validationFailureAction: Auditbackground: truerules:- name: secrets-not-from-env-varsmatch:any:- resources:kinds:- Podvalidate:message: Secrets must be mounted as volumes, not as environment variables.pattern:spec:containers:- name: "*""=(env)":- "=(valueFrom)":X(secretKeyRef): "null"- name: secrets-not-from-envfrommatch:any:- resources:kinds:- Podvalidate:message: Secrets must not come from envFrom statements.pattern:spec:containers:- name: "*""=(envFrom)":- X(secretRef): "null"
This policy prevents the use of the default project in an Application.
Services of type LoadBalancer when deployed inside AWS have support for transport encryption if it is enabled via an annotation. This policy requires that Services of type LoadBalancer contain the annotation service.beta.kubernetes.io/aws-load-balancer-ssl-cert with some value.
This policy prevents updates to the project field after an Application is created.