Audit logs append-only: no deletion, modification, or truncation
Why it matters
An audit log that can be edited or deleted is not an audit log — it is a mutable ledger that any database administrator, compromised application role, or insider threat can silently rewrite. SOX §404 requires that internal controls over financial reporting be reliable; a log table with UPDATE or DELETE grants on the application role fails that test on its face. PCI-DSS 4.0 Req-10.3 requires protection of audit logs from destruction and unauthorized modification. FINRA Rule 4511 (book-and-records) requires that records be preserved in a non-rewriteable, non-erasable format. NIST 800-53 AU-9 mandates protection of audit information from unauthorized access, modification, and deletion. CWE-284 (Improper Access Control) is the vulnerability class. An attacker who gains write access to a role that can UPDATE transaction_logs can backdate or erase evidence of fund transfers with no trace.
Severity rationale
Critical because a single UPDATE or DELETE on an audit row can permanently destroy the evidentiary chain of custody that regulators, courts, and forensic investigators rely on.
Remediation
Explicitly REVOKE modification permissions in a migration under db/migrations/ or supabase/migrations/ — implicit defaults are not sufficient and do not count as pass:
REVOKE ALL ON transaction_logs FROM app_role;
GRANT INSERT, SELECT ON transaction_logs TO app_role;
-- Only a superuser/DBA role may ever touch rows
GRANT ALL ON transaction_logs TO dba_role;
For PostgreSQL with row-level security, add an INSERT-only policy and intentionally leave out UPDATE and DELETE policies so those operations are denied by default:
ALTER TABLE transaction_logs ENABLE ROW LEVEL SECURITY;
CREATE POLICY rls_insert_only ON transaction_logs
FOR INSERT TO app_role WITH CHECK (true);
-- No UPDATE/DELETE/TRUNCATE policy means those paths are blocked.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Financial Audit Trail Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-284 — Improper Access Control
- nist:rev5 · AU-9 — Protection of Audit Information
- pci-dss:4.0 · Req 10.3 — Protect audit logs from destruction and unauthorized modifications
- sox · Section 404 — Management Assessment of Internal Controls
- external · FINRA-Rule-4511 — FINRA Rule 4511 — General Requirements for Books and Records
Taxons
History
- 2026-04-18·v1.0.0·Initial import from finserv-audit-trail·automated