Check ID:
Provider: Kubernetes
Service:
Severity: HIGH
Categories:
Resource type:
core_no_secrets_envsProvider: Kubernetes
Service:
coreSeverity: HIGH
Categories:
secretsResource type:
PodWhat this check verifies
Kubernetes Pods containers define environment variables sourced from Secrets viasecretKeyRef instead of mounting them as files.
Risk
Secrets in env vars weaken confidentiality:- Leak via logs, dumps,
/proc/*/environ, debug UIs, and pod metadata - Propagate to child processes; rotation is hard Attackers can steal credentials for unauthorized access and lateral movement, risking data integrity and service availability.
Recommendation
Use Secrets as files (read-only volumes) and load at runtime.- Apply least privilege RBAC to Secret access
- Scope Secrets to required containers; avoid logging env
- Prefer short-lived creds and regular rotation; set
immutable: truewhen suitable - Layer defense in depth with network and runtime controls
Remediation
- Terraform
- Dashboard steps
References
- https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-over-environment-variables
- https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets
Where this check fires
This check runs on every scheduled scan against your Kubernetes account. Findings appear at Cloud Security → Findings filterable byCheck ID = core_no_secrets_envs. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Kubernetes checks