Skip to content
shiporbreak

No streak yet

Sign in

November 12, 2026 路 #57

KubernetesEasyOpen write-up

The password in the ConfigMap

Every developer has read-only view access to this namespace. Which line exposes production credentials to all of them?

apiVersion: v1
kind: ConfigMap
metadata:
  name: api-config
data:
  LOG_LEVEL: info
  DB_HOST: billing-db.internal
  DB_PASSWORD: s3cr3t-pr0d-pa55
  FEATURE_FLAGS: "checkout_v2=true"

Next puzzle in UTC

One try. The first answer sticks.

How to fix it

The default view ClusterRole can read ConfigMaps but not Secrets. Anything here is visible to every viewer and every tool that dumps config. Use a Secret.

Kubernetes treats ConfigMaps as non-sensitive. The built-in view role grants get and list on them, dashboards render them, kubectl describe prints them, and they are commonly committed to git as plain YAML. Secrets are excluded from view, can be encrypted at rest, and can be restricted with RBAC per name.

A Secret is base64 encoded, not encrypted, so keep its manifest out of git too.

Fix

kubectl create secret generic api-db \
  --from-literal=DB_PASSWORD="$(vault read -field=password secret/billing-db)"
          envFrom:
            - configMapRef: { name: api-config }
            - secretRef: { name: api-db }

Rotate the password, since it has already been exposed. Consider External Secrets Operator or the Secrets Store CSI driver to sync from a vault.

Sponsor this spot

Put your tool on the puzzle
One labeled card, in front of engineers who show up every day from YouTube, TikTok, and Instagram.