Audit log: file-on-PVC sink doesn't reach central logging and isn't tamper-evident #35
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/anz#35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
anz writes audit events (
AuditEventinsrc/audit.rs) to a local file(
audit.log, on the PVC in the homelab deployment). In a Kubernetes clusterwhose log pipeline scrapes container stdout (our Loki + otel-collector-logs
setup), this means the audit events never leave the node, while ordinary
operational stdout does. The file-based sink also provides no meaningful
tamper-resistance over stdout.
How it surfaced
Wiring up navidocs (
docs.navicore.tech) machine-to-machine auth via the newclient_credentialsgrant: a failed attempt (wrong client secret) returned401but produced nothing inkubectl logsfor anz — because the auditevent goes to the audit-log file, not stdout. (A
tracing::warn!has since beenadded to the
client_credentialsreject path, which does reach stdout/Loki —that is currently the only audit-ish signal that leaves the host.)
The problem
stdout is the anz process (or node root), and that same principal can edit
audit.login place. Neither forces an attacker to cross a boundary twice.container stdout (
/var/log/pods/...), not in-container PVC files, soaudit.logis a single unreplicated copy sitting next to the audited system,while stdout would flow off-host to Loki.
stable schema / independent retention / compliance framing — but not by
tamper-resistance, which is where the current design reads backwards.
Where audit integrity actually comes from (increasing assurance)
win: also emit each
AuditEventto stdout as a structured JSON line so Lokiingests it.
WORM, or a Loki tenant the anz service account can't delete from.
(
prev_hash), optionally signed, so deletion/edits are detectable even ifthe sink is compromised. A plain appendable file can't offer this.
Proposed (incremental)
AuditEventto stdout as structured JSON (in addition to, orinstead of, the file) so it reaches central logging. Smallest,
highest-value change.
integrity control.
seq+prev_hashtoAuditEventfor tamper-evidence;consider signing.
References
src/audit.rs—AuditEvent,AuditLogger(file sink),LogEventParamsclient_credentialsintegration;docs/ROADMAP.mdKnown Gaps.