6 Kubernetes Secrets Security Controls From Storage to Pod

Kubernetes secrets security takes six controls, not one: encryption at rest, RBAC limited to the Secrets a workload actually mounts, a namespace boundary around pod creation, container and node scoping, an external store with short-lived credentials, and audit evidence that the other five are working. Etcd encryption alone leaves the API read path open, and a tightly scoped role does nothing for a Secret that is still stored as a plain object.
Kubernetes stores Secrets unencrypted in etcd by default, so anyone with API access can retrieve or modify a Secret. That is the default condition on a cluster nobody has changed, and it explains why the review below follows the path a value travels rather than the order of a settings checklist. Each control closes one segment of that path and names the evidence that proves it.
What Encryption at Rest Covers
Encryption at rest protects data stored in etcd, not API responses. The kube-apiserver reads an encryption provider configuration, and the first provider in that list decides how new writes are stored. If the identity provider sits first, the cluster has no at-rest encryption at all: the identity provider is the default and stores resources as plain text. A cluster can therefore pass a configuration review and still hold readable Secrets on disk.
Two limits matter more than the cipher you pick. Enabling encryption does not rewrite existing objects: Secrets written before the change stay unencrypted until they are stored again, which is why the upstream procedure replaces every Secret after the new key is in place. And encryption does nothing for a subject that is allowed to read a Secret through the API, because that reader receives the decrypted value.
Provider choice is a question of key custody. Local providers keep key material on the control plane host, so anyone who reaches that host can decrypt the data store. A KMS-backed provider uses envelope encryption, with data keys wrapped by a key that stays in the external service, and rotating the key becomes an operation in that service rather than a file edit on every control plane node. For a Secret that grants access to a production database, that difference is the control.
RBAC Grants That Leak
Authorization decides who receives the decrypted value, and Kubernetes does not treat list and watch on Secrets as metadata operations: granting list access to Secrets implicitly lets the subject fetch the contents of the Secrets. A role that looks read-only hands over every credential in a namespace at once. Scope roles to get on the named Secrets a workload mounts, keep list and watch for the system-level controllers that need them, and record every binding that still carries the broader verbs.
The subtler leak is pod creation. Treat pod creation rights as secret read rights. Anyone authorized to create a Pod in a namespace can use that access to read any Secret in that namespace, because the new Pod can mount any Secret that exists there, and this includes indirect access such as the ability to create a Deployment. A pipeline identity with create on Deployments never needs the word Secret in its role to take a registry pull credential from the same namespace.
Hypothetical example, not a measured case: a staging namespace holds a pull Secret and grants a deployer ServiceAccount create on Deployments, while its role lists no Secrets at all. The deployer mounts the pull Secret through the Pod it creates. The design choices are to move the credential out of any namespace where untrusted identities can create objects, to bind it to a specific service account through an external store, or to restrict who can create Pods there. Which one fits depends on who else needs to deploy into that namespace.
Pair the role export with an API access review. The site’s guide to auditing Kubernetes anonymous API access covers the authentication side of the same question: which requests reach the API server without a credential and what that identity is allowed to do.
External Vaults and CSI
An external secret store removes the Secret object from etcd altogether. The Kubernetes Secrets Store CSI Driver is a DaemonSet that lets the kubelet retrieve Secrets from external stores and mount them as a volume into the Pods you authorize. The value lives in the vault, reaches the node only for the Pods that request it, and never becomes a cluster object that a role can list.
The trade-off is availability. The application now depends on the vault and on the driver being reachable when the Pod starts, and the Pod cannot start until the volume mounts, so a vault outage becomes a Pod start failure. Decide in advance what happens when the vault is unavailable and test that decision during a maintenance window. If you also enforce secret policy through admission control, the same availability question applies to the policy itself; the site’s guide to admission webhook outages covers how to decide what fails open safely.
Rotation and Audit Evidence
Short-lived credentials change the blast radius of every other control. When a leaked value expires by itself, the question after an incident becomes how many Secrets were read before rotation, not how long a static password stays valid. Vault’s Kubernetes auth method lets a workload authenticate with its Service Account token, and the role bound to that login decides which service accounts and namespaces may log in and how long the resulting token lives. Rotation becomes a property of the login instead of a calendar task that someone forgets.
Container and node scope deserve the same review. A Secret is only sent to a node if a Pod on that node requires it, and the kubelet keeps its copy in a tmpfs rather than on durable storage, but any container that runs with privileged access on a node can reach all Secrets used on that node. In a Pod with several containers, mount the Secret only into the container that signs or authenticates and keep it away from the container that serves traffic. On the node, that means treating privileged Pods as readers of every Secret scheduled beside them.
Audit rules close the loop. Kubernetes guidance recommends audit rules that alert on a pattern no single request reveals, such as one identity reading several Secrets in quick succession, which looks like a harvesting script rather than a normal application start. A policy without a logged test is a claim, not a control. Record the Secret name, the requesting identity, the verb and the response in the review evidence, then trigger a test read and confirm the alert fires.
Keep the application side honest as well. Base64 encoding is not an encryption method, so a Secret manifest committed to a repository is exposed to everyone who can read the manifest, and a value printed to standard output lands in the log pipeline however carefully it was stored. Secret manifests belong in the same handling class as the values they carry.
Six Controls Compared
Use the table as the review record. Fill the evidence column with an artifact from your own cluster and mark a control unknown where you cannot observe it; an untested control is not a pass.
| # | Control | Path it closes | Path it leaves open | Evidence to record |
|---|---|---|---|---|
| 1 | Encryption at rest with a KMS-backed provider | Reads of etcd disks, replicas and backups | API reads by an authorized subject | Provider configuration, key custody owner, rewrite of existing Secrets |
| 2 | RBAC limited to get on named Secrets | Namespace-wide credential listing | Pod creation rights in the same namespace | Exported roles and bindings with their verbs |
| 3 | Namespace boundary around pod creation | Workloads mounting Secrets they were never granted | Service accounts that legitimately need the Secret | Who can create Pods in each namespace that holds a Secret |
| 4 | External store with short-lived credentials | Secret objects persisted in etcd | Vault and driver availability when a Pod starts | Vault role bindings and token lifetime |
| 5 | Container and node scoping | Sidecar containers and privileged neighbors on the node | The container that mounts the Secret by design | Pod specs showing which container mounts each Secret |
| 6 | Audit evidence on Secret reads | Undetected harvesting by an authorized identity | Values that never pass through the API | Audit policy and the result of a test read |
Run the review in this order:
- Export every role and binding that names Secrets and mark the verbs; treat list and watch as full read access.
- List the namespaces where a non-administrator identity can create Pods and compare that set with the namespaces that hold credentials.
- Read the API server encryption configuration and record the first provider and where its keys live.
- Compare the Secrets that remain plain objects with the data already available from an external store.
- Trigger a known Secret read and confirm that the audit alert fires; if nothing fires, the control is untested.
The sources were reviewed on November 25, 2026. The examples above are hypothetical and describe no real cluster; apply the method to the configuration and supported controls of your own Kubernetes distribution before changing a control plane.