infra(logging): ship kube-apiserver audit log with secret bodies stripped #59

Merged
sirius merged 1 commit from wt/t_34ddaa83 into master 2026-11-27 05:49:16 +00:00

2026-11-27

Lance Walters
infra(logging): ship kube-apiserver audit log with secret bodies stripped
t_104f62a6 made the apiserver audit log live on siriussec:
/var/log/kubernetes/audit/audit.log, mode 600 root, ~2.2 GB/day, rotated by the
apiserver itself (100 MB x 48, compressed). A pod-log collector never sees a
host file, so Alloy gets a read-only hostPath mount for that directory.

The file MUST NOT be shipped verbatim: at level=RequestResponse every
'get secrets' record carries responseObject.data — the plaintext secret.
The shipper therefore parses each record and re-emits a packed allowlist
(level, stage, verb, user, objectRef.*, responseStatus.code, sourceIPs[0],
userAgent, auditID, requestURI, requestReceivedTimestamp). requestObject and
responseObject never reach Loki; unparseable lines are dropped by stage.json
rather than passed through.

Nothing in that directory is written or pruned by the collector: the
apiserver's own 4.8 GB / 7-day rotation stays the only thing pruning it.
2026-11-27 00:49:07 -05:00