controlplane: audit — full bodies for secret writes, metadata only for list/watch
Measured on the live cluster: the 22.8 GB/day burst was driven by `list secrets` (1.9 MiB per event — every secret in the namespace) and by helm-controller rewriting its release blobs. Only list/watch give up their bodies now, so "who rewrote this secret, and to what" stays reconstructable; steady state is 0.79 GB/day / ~420 events/min, i.e. ~6 days inside 48 x 100 MiB. Re-verified after the change: create secret (server dry-run) records requestObject.data; get/patch behave the same.
This commit is contained in:
parent
f9d2594fe9
commit
2c7eab2b0b
2 changed files with 34 additions and 26 deletions
|
|
@ -8,12 +8,13 @@ omitStages:
|
|||
omitManagedFields: true
|
||||
|
||||
# Volume note (measured 2026-11-27 on this cluster): full bodies for EVERY secret
|
||||
# verb cost 22.8 GB/day, because (a) flux helm-controller lists all secrets
|
||||
# (1.9 MiB per list) and (b) it rewrites sh.helm.release.v1.* release blobs
|
||||
# (~170 KiB each) every reconcile, plus prometheus-operator rewrites its
|
||||
# tls-assets secrets. Rule 4 therefore keeps identity+object for those two
|
||||
# verbs and reserves bodies for the single-object paths (rule 5) that actually
|
||||
# answer "who read / who wrote this one 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.
|
||||
rules:
|
||||
# ---------------------------------------------------------------- 1. silence
|
||||
# Liveness/version/discovery surface: polled by kubelet on every node every
|
||||
|
|
@ -63,12 +64,14 @@ rules:
|
|||
- group: storage.k8s.io
|
||||
resources: ["storageclasses"]
|
||||
|
||||
# ------------------------------- 2. secrets: bulk enumeration / automation rewrite
|
||||
# user + verb + namespace/name + responseStatus, no bodies. list secrets is
|
||||
# 1.9 MiB of every secret in the namespace; update is the flux helm release
|
||||
# churn. Losing the body here loses only a copy of what etcd already holds.
|
||||
# ---------------------------- 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.
|
||||
- level: Metadata
|
||||
verbs: ["list", "watch", "update"]
|
||||
verbs: ["list", "watch"]
|
||||
resources:
|
||||
- group: ""
|
||||
resources: ["secrets"]
|
||||
|
|
@ -89,7 +92,6 @@ rules:
|
|||
# create/patch requests carry live secret values. 0600 root, never shipped
|
||||
# off-node over an unauthenticated path.
|
||||
- level: RequestResponse
|
||||
verbs: ["get", "create", "patch", "delete", "deletecollection"]
|
||||
resources:
|
||||
- group: ""
|
||||
resources: ["secrets"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue