audit(policy): drop bodies for secret reads, keep them for writes

The log was a second plaintext copy of every secret that had been read: of 3,527
secret events on the live log, 2,574 carried .data in responseObject (1,606 were
plain get). A get is fully described by objectRef + user + sourceIPs +
responseStatus; the body adds a credential and no forensic value, and root reading
the root-only log produces no audit event at all.

- rule 4a: secrets get/list/watch -> Metadata
- rule 4b: secrets create/update/patch/delete/deletecollection -> RequestResponse
  (the tampering verbs; the body there is the evidence)
- everything else untouched: pods/exec, tokenreviews, RBAC/cert writes, proxies

docs: rule table, read/write rationale, sensitivity + purge notes.
This commit is contained in:
Lance Walters 2026-11-27 00:49:13 -05:00
commit 09faa710c7
2 changed files with 60 additions and 33 deletions

View file

@ -7,14 +7,20 @@ omitStages:
# server-managed noise, never evidence
omitManagedFields: true
# Volume note (measured 2026-11-27 on this cluster): full bodies for EVERY secret
# Volume note (measured 2026-11-27 on this cluster): full bodies for every secret
# verb peaked at 22.8 GB/day, driven almost entirely by `list secrets` (1.9 MiB per
# event: flux helm-controller enumerating every secret on each reconcile) during a
# reconcile storm. Only rule 2 gives up bodies, and only for list/watch, where the
# body is a corpus dump rather than evidence. Everything else - including secret
# writes - keeps full request/response. Measured steady state: ~2.2 GB/day total,
# ~0.25 GB/day of which is secret traffic; a reconcile storm adds a bounded burst
# that rotation absorbs.
# reconcile storm.
#
# Read/write split: secret READS (get/list/watch) are Metadata - the body is a
# credential and objectRef already answers who/which/from where. Secret WRITES
# (create/update/patch/delete) keep full request/response - the body there is the
# evidence (an attacker planting their own key), not a credential to protect.
# Measured before the split: 2,574 of 3,527 secret events carried `.data` in
# responseObject, i.e. the log was a second copy of every secret that had been read.
# Everything else - pods/exec, tokenreviews, RBAC writes, proxies - is unchanged.
# Measured steady state: ~2.2 GB/day total, ~0.25 GB/day of which is secret traffic;
# a reconcile storm adds a bounded burst that rotation absorbs.
rules:
# ---------------------------------------------------------------- 1. silence
# Liveness/version/discovery surface: polled by kubelet on every node every
@ -64,14 +70,26 @@ rules:
- group: storage.k8s.io
resources: ["storageclasses"]
# ---------------------------- 2. secrets: bulk enumeration (corpus dumps only)
# A list returns EVERY secret in the namespace: measured 1.9 MiB per event, and a
# flux reconcile storm issues dozens. Identity + verb + namespace is the signal
# (mass enumeration); the body is just the corpus. Writes are NOT here - they stay
# at RequestResponse in rule 4, because "who rewrote this secret and to what" is
# evidence. Steady state with this split: ~0.25 GB/day of secret traffic.
# ---------------------- 4a. secrets: READS (corpus + single object) = Metadata
# `list` returns EVERY secret in the namespace (measured 1.9 MiB per event, dozens
# per flux reconcile storm); `get` returns one object whose responseObject.data is
# the live credential. Neither body is evidence: objectRef + user + sourceIPs +
# responseStatus fully answers "who read which secret, when, and did it succeed".
# Keeping the body writes a second plaintext copy of every secret into a root-only
# file that no audit event covers (root can read the log without touching the API).
- level: Metadata
verbs: ["list", "watch"]
verbs: ["get", "list", "watch"]
resources:
- group: ""
resources: ["secrets"]
# -------------------- 4b. secrets: WRITES = full request/response bodies
# The tampering verbs. Here the body IS the evidence: who planted which key, who
# rewrote the forgejo-pull dockerconfigjson, who deleted the SOPS age key secret.
# Verbs are enumerated so an unknown future verb falls through to Metadata (rule 6)
# rather than silently acquiring a body.
- level: RequestResponse
verbs: ["create", "update", "patch", "delete", "deletecollection"]
resources:
- group: ""
resources: ["secrets"]
@ -87,15 +105,6 @@ rules:
- group: certificates.k8s.io
resources: ["*"]
# --------------------- 4. secrets: single-object read/write, full bodies
# THIS FILE IS SECRET MATERIAL from here on: get/read responses and
# create/patch requests carry live secret values. 0600 root, never shipped
# off-node over an unauthenticated path.
- level: RequestResponse
resources:
- group: ""
resources: ["secrets"]
# -------------------------------- 5. everything privileged-but-authorized
- level: RequestResponse
resources: