Skip to content
tezvyn:

Are base64-encoded Kubernetes Secrets actually secure?

Source: interviewMediumHow cards are made

Summary

understanding that encoding is not encryption.

Key points

base64 is reversible, not a protection; default guards against accidental shoulder-surfing only; real defenses are encryption-at-rest, RBAC, audit.

What's really being asked

The interviewer wants to know whether you grasp the difference between encoding and encryption, and whether you understand where Kubernetes Secrets are actually exposed. It is a security-literacy filter.

The full answer

Base64 is a reversible encoding with no key, so it provides zero confidentiality; anyone can decode it instantly. The default behavior exists so that binary secret data can be embedded in YAML and JSON safely, and so values are not splattered as raw bytes across tooling. The threat it loosely addresses is casual over-the-shoulder viewing of a manifest, not a real attacker. Anyone with read access to etcd, with access to the node disk where etcd stores data, or with RBAC permission to get the Secret object can recover the plaintext. Genuine protection comes from enabling encryption at rest via an EncryptionConfiguration backed by a KMS provider, locking down RBAC so few subjects can read Secrets, restricting etcd network and disk access, and enabling audit logging.

The mistakes people make

Claiming Secrets are encrypted by default, or that base64 is a security measure. Saying that because data is in etcd it is automatically safe. Forgetting that mounted Secrets land in tmpfs readable by the Pod's processes.

What usually comes next

How do you enable encryption at rest? How does envelope encryption with a KMS plugin work? How would you rotate the data encryption key? Why might you prefer an external secret store over etcd entirely?

A concrete example

Run kubectl get secret db-creds -o jsonpath='{.data.password}' and pipe through base64 -d; the password appears in cleartext with no key required, proving the encoding is cosmetic. Contrast this with configuring an aescbc or kms provider in the API server's EncryptionConfiguration so the bytes in etcd are ciphertext.

Interview question

An auditor finds Kubernetes Secrets stored base64-encoded in etcd. What does this encoding actually provide?

  • a.Protection against anyone with etcd read access
  • b.Strong symmetric encryption tied to the cluster key
  • c.Per-namespace access control over the values
  • d.No confidentiality; it is a reversible encoding onlyCorrect
Why?

Base64 is a keyless reversible encoding that anyone can decode, so it provides no confidentiality. It is not encryption and does nothing to stop an attacker with etcd or RBAC read access.

Just read this? Test yourself on what you have been reading.

Read the original → kubernetes.io

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on kubernetes — each one lists the topics its interview covers.

See open roles