A Secret is base64, not encryption The developer applies a Secret db-pass with data.password: czNjcjN0. That is just base64 of s3cr3t. Anyone who sees the manifest or runs kubectl get secret -o yaml can decode it in one command.
base64 exists so binary values fit in YAML and JSON. It gives no protection at all.
By default etcd holds the value in plain text The API server writes the Secret to etcd under /registry/secrets/<namespace>/<name>. Without encryption at rest the default provider is identity, which means no encryption. The bytes in etcd contain s3cr3t as is.
So anyone who can read etcd directly, or who gets an etcd snapshot or a node disk backup, gets every password in the cluster without going through RBAC.
Watch out Protect etcd like the vault it is: TLS client certificates, no network access except from the API server, and encrypted backups.
An EncryptionConfiguration makes the API server encrypt before it writes The API server is started with --encryption-provider-config pointing to an EncryptionConfiguration. It lists providers per resource. The first provider encrypts new writes, and every provider in the list can still decrypt.
Encryption happens in the API server, so etcd and its backups only ever see ciphertext such as k8s:enc:aescbc:v1:key1:… Existing Secrets stay plain until they are written again, so after turning it on you rewrite them all.
Key idea A local aescbc or secretbox key sits in a file on the control plane node. Whoever can read that file can decrypt etcd, which is why KMS is preferred.
Envelope encryption keeps the master key outside the cluster With the KMS v2 provider, the API server encrypts data with a data encryption key (DEK). The DEK is itself encrypted by a key encryption key (KEK) that never leaves the external KMS, such as a cloud KMS or an HSM, through a KMS plugin.
The wrapped DEK is stored next to the ciphertext. The API server keeps the plain DEK in memory, so it does not call the KMS for every read. Revoking access to the KEK makes the etcd data unreadable even with a full copy of etcd.
Key idea Envelope encryption: data is encrypted by a DEK, the DEK is encrypted by a KEK in the KMS. Rotating the KEK does not require re-encrypting every Secret at once.
Encryption at rest does not stop anyone RBAC lets in The API server decrypts for any request that passes RBAC. A user granted list on secrets in namespace shop gets the full data of every Secret there, not just the names. watch is the same.
Permission to create Pods is just as strong: a Pod in that namespace can mount any Secret and print it. Workloads that can create Pods, or CI service accounts with wide roles, are a common leak path.
Watch out Give get on named Secrets only to what needs them, avoid list and watch on secrets, and record secret reads in the audit log at Metadata level.
A Secret manifest in Git is leaked for good With GitOps everything goes through Git, and a Secret YAML ends up committed. base64 hides nothing, and deleting the file later does not remove it from history or from clones and forks.
Two common fixes keep only ciphertext in Git. Sealed Secrets encrypts with the public key of a controller in the cluster, and only that controller can turn the SealedSecret back into a Secret. SOPS encrypts the values with a KMS or age key and decrypts them at deploy time.
Watch out If a secret ever reached Git in plain form, treat it as leaked: rotate it, then clean the history.
An external vault stays the source, and an operator syncs it in Another option keeps the value outside both Git and the cluster: in HashiCorp Vault, AWS Secrets Manager, Google Secret Manager or Azure Key Vault. Git only holds an ExternalSecret that says which key to fetch.
The External Secrets Operator authenticates to the vault through a SecretStore, often with the Pod's workload identity instead of a stored key. It reads the value and creates the Secret db-pass, then checks again every refreshInterval. The Pod uses an ordinary Secret.
Key idea The Secrets Store CSI Driver is the other common pattern: it mounts the value from the vault straight into the Pod as a file. By default it creates no Secret object; syncing to a Secret is optional.
Rotation: the vault changes, but the app must pick it up Security rotates the password in the vault. On the next refresh the operator updates the Secret. A Secret mounted as a volume is updated in the Pod after a short delay; an environment variable keeps the old value until the container restarts.
Even a refreshed file only helps if the app reads it again. Many apps read the password once at startup, so rotation also needs a rolling restart, or a tool that restarts Pods when their Secret changes.
Watch out Rotate in two phases where the system allows it: add the new credential, roll the app, then revoke the old one. Revoking first causes an outage.
Short-lived credentials are better than any stored password Some vaults issue dynamic credentials. Vault's database secrets engine, for example, creates a new DB user for each request with a lease of, say, one hour, and drops that user when the lease ends.
Now there is no long-lived password to leak. A copied credential stops working on its own, and each app instance has its own user, so the DB log shows exactly who did what.
Protect the secret where it is stored, who reads it, and where it comes from At rest: encrypt Secrets in etcd, preferably with KMS v2, and guard etcd and its backups. Access: give get on named Secrets only, and remember that creating Pods means reading Secrets.
Source: keep plain values out of Git with Sealed Secrets, SOPS or an external vault, and prefer short-lived credentials so a leak expires by itself.
Summary A Secret object is a delivery mechanism, not a safe. Safety comes from encryption at rest, tight RBAC, nothing plain in Git, and rotation that the app actually picks up.