Database Auditing
Cheat sheet · https://pcornel.dk/topic.php?topic=6193
Answer
Database auditing records who did what — logins, privilege changes, DDL and access to sensitive data — using pgAudit, MariaDB audit plugin, MySQL Enterprise Audit or SQL Server Audit.
Remember
Audit privileged actions and sensitive tables, not every SELECT. Ship audit logs off the server. Watch performance impact.
First checks
sys.server_audits— first check for this topicpsql -c "SELECT now(), version();"— PostgreSQL reachable and versionmysql -e "SELECT NOW(), VERSION();"— MariaDB/MySQL reachable and versionsqlcmd -S <server> -Q "SELECT @@VERSION"— SQL Server reachable and version
Verify in this order
action → audit rule → record → central log
Where it usually breaks
Auditing every SELECT on a busy system can hurt performance and fill disks.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6193