Containers · Term

What is etcd?

etcd is the database behind every Kubernetes cluster, and it holds every secret in plain form by default. Reach it unauthenticated and you own the cluster. Here is what etcd is and why it must be locked down.

Containers · TermCloud Penetration Testing
TL;DR

etcd is the key-value database that stores all Kubernetes cluster state, every object, configuration, and Secret. By default Secrets are stored only base64-encoded, not encrypted, so anyone who can read etcd can read every credential in the cluster. etcd listens on port 2379, and if it is reachable without client-certificate authentication, it is a full cluster compromise. Protect it with mutual TLS, network isolation, and encryption of Secrets at rest.

By John Dill, Red Team Lead, SecureLayer7Updated

What etcd is

Kubernetes itself is stateless logic; the state lives in etcd, a distributed key-value store. When you create a pod, a config map, or a Secret, it is written to etcd. The API server is essentially a guarded front end over etcd.

That makes etcd the crown jewels: it contains everything, including Secrets. Critically, Secrets are stored base64-encoded by default, which is encoding, not encryption, so reading etcd reveals them in usable form.

The abuse and payload

If etcd (port 2379) is reachable without client-cert auth:

  • Read every key, including Secrets: etcdctl --endpoints=https://NODE:2379 get / --prefix --keys-only then fetch Secret values.
  • The returned Secret data is base64, trivially decoded into real credentials, tokens, and TLS keys.
  • With those, authenticate to the API server or downstream systems and take over the cluster and its cloud account.

A backup of etcd left unprotected is the same exposure. Documented techniques shown for defenders.

How to defend

  • Require mutual TLS (client certificates) for all etcd access; never allow anonymous connections.
  • Network-isolate etcd so only the API server (control plane) can reach 2379.
  • Enable encryption at rest for Secrets so etcd does not store them in recoverable form.
  • Protect etcd backups with the same controls and encryption as the live store.
  • Audit and test that etcd is unreachable from workloads and the network.

References

  1. [1]Kubernetes docs: Securing a cluster(Kubernetes)
  2. [2]MITRE ATT&CK: Containers Matrix(MITRE)
  3. [3]NIST SP 800-190 Application Container Security Guide(NIST)
Related terms

Common questions

Container security, asked often

Want your containers and clusters tested for these paths?

Scope an engagement

Find the container escape paths before an attacker does.

We test your Docker hosts and Kubernetes clusters the way a real intruder would, from a compromised pod to the node and the rest of the cluster, then hand your team reproducible evidence and a fix for every step. Free re-test included.

See cloud penetration testing30-min scoping call, fixed-price proposal in 48 hours.