Skip to main content

More Info:

Storing secrets in an external, dedicated secrets management system reduces the risk of exposure through the Kubernetes API and etcd. Evaluate cloud provider or third-party secret stores.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. Inventory current Kubernetes Secret usage
    • Run on: any machine with kubectl access
    • List all Secrets by type to understand what data is stored in-cluster:
    • Spot candidates for externalization (e.g., Opaque, kubernetes.io/basic-auth, kubernetes.io/dockerconfigjson).
  2. Identify workloads dependent on sensitive Secrets
    • Run on: any machine with kubectl access
    • Find which Pods reference which Secrets (env vars and volume mounts):
    • Prioritize Secrets used by internet-facing, privileged, or critical workloads for potential migration to an external store.
  3. Review existing external secret store integrations
    • Run on: any machine with kubectl access
    • Check for common integrations (adapt namespace if needed):
    • If such components exist, inspect their configuration/manifests to confirm which Secrets are already backed by an external provider.
  4. Evaluate cloud/third‑party options and select a standard
    • Out-of-band review (console/IaC)
    • For your cloud (e.g., AWS, Azure, GCP, OCI) or third‑party (e.g., Vault), review available services (KMS-integrated secret stores, dedicated secret managers) and Kubernetes integrations (CSI driver, External Secrets Operator, Vault Agent, etc.).
    • Decide on:
      • A primary external secret system for new workloads.
      • An access model (service accounts, IAM roles, workload identity).
      • A rollout approach (new apps first vs. migrating existing Secrets).
  5. Pilot configuration using manifests / IaC
    • Run on: any machine with kubectl access
    • Deploy the chosen integration in a non‑production namespace using manifests or existing IaC, then create one test Secret through the external system and expose it to a test Pod. Example (generic pattern, adapt to chosen tool):
    • Confirm the Pod can read the secret value at runtime (e.g., via kubectl exec into the test Pod).
  6. Plan and verify migration away from in‑cluster Secrets
    • Run on: any machine with kubectl access
    • For each high‑priority Kubernetes Secret selected in step 2:
      • Create the equivalent secret entry in the external store.
      • Update Pod/Deployment manifests (or Helm/IaC) to consume it via the chosen integration instead of a native Secret.
    • Verify you are reducing in‑cluster Secrets over time:
    • Track this count and the list from step 1 periodically to confirm that sensitive data is increasingly sourced from the external store rather than native Secret objects.
Look for non-system namespaces where applications run (exclude kube-system, kube-public, kube-node-lease by default).
Problems indicated by:
  • Large numbers of Secrets in a namespace.
  • Many Pods consuming the same sensitive-looking Secrets (db-password, api-key, tls-*, jwt-secret, etc.), showing widespread in-cluster secret reliance.
Problems indicated by:
  • Generic Opaque secrets holding passwords, API tokens, or database credentials.
  • Long-lived, non-rotated credentials (age in kubectl get secrets is very large).
  • Application credentials stored as Secrets instead of being sourced from an external manager.
Problems indicated by:
  • Many workloads directly depending on Kubernetes Secrets without any reference to an external secret provider.
  • Secrets used broadly across multiple deployments, suggesting central, static credentials.
Problems indicated by:
  • No secretproviderclass resource available or none defined in application namespaces.
  • No other custom resources related to external secret integrations (e.g., ExternalSecret, VaultSecret).
Problems indicated by:
  • No CRDs or Pods related to any external secret operator / CSI driver / vault agent.
  • All secret handling apparently done via native Kubernetes Secrets only.
In that YAML, look for:
  • env.valueFrom.secretKeyRef and volumes.secret.secretName referencing Kubernetes Secrets.
  • Absence of environment variables or volumes that would be populated via an external provider (e.g., csi driver volumes, vault agent sidecars, external-secrets annotations).
Problems indicated by:
  • Critical app credentials (database, payment gateway, upstream APIs) all coming from Kubernetes Secrets.
  • No integration pattern (sidecar, CSI, operator) that suggests use of a cloud/third-party secret manager.
These commands only surface the current state. A human must decide whether the sensitivity and spread of in-cluster Secrets justify adopting an external secrets management solution per the benchmark guidance.