Lesson 12 of 13 · 12m
Secrets Are Base64, Not Encrypted
etcd plaintext by default, kms v2 encryption config, why resourceNames can't narrow list/watch, and env versus volume versus CSI driver.
The name is lying to you
kubectl create secret generic db --from-literal=password=hunter2 writes a Secret object into etcd where the value is base64. Not encrypted — base64. (stringData is the write-side convenience field that merges into data on create and is never stored.) kubectl get secret db -o yaml prints it; | base64 -d prints plaintext. The object named Secret is a labeled map of credentials in the cluster's datastore, and its entire protection model is the list of who may get, list, and watch secrets in that namespace.
That RBAC boundary is coarser than people assume. resourceNames narrows get/update/delete to named secrets — but list and watch ignore resourceNames entirely. There is no way to grant "list only the app secret." Anyone who can list secrets in a namespace can read all of them. The practical consequence: secrets that must be separated go in separate namespaces, not separate objects.
Encryption at rest is opt-in
Out of the box, etcd holds plaintext. --encryption-provider-config points at an EncryptionConfiguration with an ordered provider list:
resources:
- resources: [secrets]
providers:
- kms:
name: aws-kms
endpoint: unix:///var/run/kmsplugin.sock
- identity: {}The first provider encrypts new writes; the list's order also governs reads during migration, and identity literally means plaintext passthrough — listing it first means you configured nothing. aescbc encrypts with a local key file (a key on the same disk as etcd — a marginal gain); secretbox symmetric; kms v2 (stable since 1.29) envelopes to AWS KMS, GCP KMS, or Vault transit — the key never lives on the etcd host. After changing providers, rewrite existing secrets (kubectl get secrets --all-namespaces -o json | kubectl replace -f -) or the old plaintext copies persist until each secret is touched.
And encryption at rest is etcd-disk protection. It does nothing about kubectl get with read rights, etcd snapshots shipped to backups, or client certs in /etc/kubernetes/pki/etcd — etcd access remains total access, which is why etcd's client TLS and firewall placement matter more than any provider choice.
Delivery is a security decision
How the secret reaches the workload changes the leak profile:
- Environment variables: injected at container start, frozen until restart (rotate the secret, pods keep the old value), visible in the pod spec and in
kubectl describe, and copied into crash dumps andkubectl exec envoutput. - Mounted volumes: projected into tmpfs as files; the kubelet refreshes them on rotation without a restart; not visible in the spec.
- Secrets Store CSI driver: mounts directly from AWS Secrets Manager, Vault, etc. — the value never lands in etcd at all.
- External Secrets Operator: syncs external stores into Secret objects — convenient for GitOps-shaped workflows, but the copy still lands in etcd under the same RBAC rules.
- Sealed Secrets (Bitnami
kubeseal): encrypts secrets against the cluster's public key so the ciphertext can live safely in git; the controller decrypts in-cluster.
And rotation is on you: Kubernetes never rotates secrets. Mounted volumes pick up a rotated value on the kubelet's sync cadence (about a minute); env-var secrets hold the old value until restart — plan rollout accordingly.
The consistent answer across every Kubernetes breach writeup: post-foothold, the attacker's next command is kubectl get secrets -A. That single read is the escalation to the cloud account. The countermeasures are exactly the unglamorous set above — kms v2 in the encryption config, namespace-scoped separation, no list/watch on secrets except for the controllers that need it, volume mounts over env vars, and audit-log Metadata coverage on secrets reads so the 03:14 dump is an alert, not a surprise.
What to actually do
Enable kms v2, scope secret reads to the smallest namespaces, treat mounted-over-env as the default, and use the CSI driver when the secret doesn't need to exist in etcd at all. The object is called Secret; the security is configuration.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
A 257-Byte Password Is the Key: Inside the OpenSSH musl Bypass
CVE-2026-123158 lets an attacker log into a locked account on musl-based systems like Alpine by sending a password nobody set. The trigger is one number, 257, and the reason is a C library returning a single asterisk. I reproduced the exact boundary against musl 1.2.4 and read the fix.
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Jellyfin's Threat Model Is Your Brother-in-Law
Four Jellyfin CVEs landed in 2026 and not one of them needs an admin account. One needs only the ability to name a file. Meanwhile Jellyfin 12 shipped in September, the version numbers stopped starting with 10, and every "am I patched" check you wrote is now wrong.
Node.js Fixed 16 Flaws in One Release. Most of Them Live in HTTP/2 and TLS.
The November 11 Node.js security releases fix 16 CVEs across the 26, 24 and 22 lines, seven of them rated high. Nearly all sit in HTTP/2 and TLS, where a remote client can crash a server, leak memory, or get past per-host client-certificate checks.