Free overview · hard · Lesson 7 of 8

Secrets in etcd and the audit log

Encrypting Secrets in etcd with a rewrite and cleanup of old revisions, and an audit policy that notices Secret reads without writing their values to the log.

The seventh lesson of the hardening track: secrets on disk and a trace in the log. By default Secrets in etcd are stored as plaintext, and a copy of the control plane disk hands over every password in the cluster, bypassing RBAC. And reading Secrets with a legitimate but stolen token leaves no trace if the apiserver doesn't write an audit log.

Threat model

Two scenarios. In the first the attacker has a copy of the etcd database file: a backup or a snapshot of the node disk. In the second they have the token of the backup ServiceAccount, which is supposed to read all Secrets as part of its job.

Attack path

  1. The etcd file from the node and a search for the password with an ordinary grep.
  2. Old revisions in the etcd file, which stay even after encryption is turned on.
  3. Reading all Secrets with the backup token during the day, without a single record in the log.

Checklist

Practice

Two labs on the shared cluster of the track. In the first you turn on Secret encryption and clean up the etcd history until a copy of the database file stops giving away the password. In the second you write an audit policy after which a Secret read with the backup token shows up in the log, while the values themselves stay out of it.

Done reading?

Mark the lesson as read to move your track progress forward.

Practice

Fix a local lab. The agent checks your work and gives hints if you get stuck.

Full access to all labs

$134 $67.00 for one year −50%

One payment, no auto-renewal · Terms

Buy for $67.00