Audit Database Access

Logged queries.

Overview

Database access auditing logs every query against the production database with user attribution, timestamp, source, and query categorisation. The audit trail is the load-bearing artifact for compliance certifications (SOC 2, HIPAA, PCI), the forensic record for breach investigation, and the input to anomaly detection that catches insider threats. The discipline is in engine-native logging (pgaudit, MySQL Enterprise Audit), tamper-resistant storage, and retention matched to regulatory requirements.

The approach

The practical approach is engine-native auditing (pgaudit for Postgres, MySQL Enterprise Audit for MySQL) for high-fidelity logs, separate audit storage from application data to reduce tampering risk, anomaly alerting on unusual access patterns (off-hours queries, unusual volume, new source IPs), and a documented audit policy committed to the security handbook covering what is logged, how long, and who can access.

Why this compounds

Audit logging compounds across years. Each retained log preserves forensic capability for the compliance window; each anomaly investigation teaches the team what normal looks like; the discipline becomes the foundation for both compliance certifications and incident response. Without it, breach investigation becomes guesswork and compliance audits become exercises in archaeology.

Database access auditing is an operational discipline that pays off across years. Nova AI Ops integrates with database telemetry, surfaces audit patterns, and supports the team’s database security discipline.