Why
The audit log is a stated security promise, but every writer treats failure as best-effort and several do not sanitize fields:
server/web/audit.goforge/identity/identity.goforge/access/store.goserver/hook/hook.goserver/ssh/admin.go
Files are created 0644; identity key comments and LFS lock paths can inject tabs/newlines into columns.
Scope
- Centralize audit formatting and sanitize tabs/newlines in every field.
- Create audit files
0600withO_APPEND. - Detect write failures and log them loudly.
- For privileged admin/ACL/account changes, fail closed (or require an explicit emergency override).
- Add a startup/health check for audit writability and ownership.
- Document shipping the audit log off-host; local append-only is not tamper-evident.
Acceptance
- A read-only or full audit filesystem causes privileged changes to fail or emit a high-severity alert, never a silent success.
- Field-injection tests pass.