Sensitive information must be stored using Kubernetes Secrets or an external Secret store provider.

STIG ID: CNTR-K8-001161  |  SRG: SRG-APP-000171-CTR-000435 |  Severity: high |  CCI: CCI-004062 |  Vulnerability Id: V-274883

Vulnerability Discussion

Sensitive information, such as passwords, keys, and tokens must not be stored in application code.

Kubernetes offers a resource called Secrets that are designed for storing sensitive information for use by applications. Secrets are created and managed separately from application code. Additionally, they can be encrypted at rest and access to the secrets can be controlled via RBAC.

Check

On the Kubernetes Master node, run the following command:
kubectl get all,cm -A -o yaml

Manually review the output for sensitive information.

If any sensitive information is found, this is a finding.

Fix

Any sensitive information found must be stored in an approved external Secret store provider or use Kubernetes Secrets (attached on an as-needed basis to pods).