Database Auditing

Comprehensive Database Audit Logging

Know who accessed what, when, from where, and why. Always.

Database auditing is the foundation of compliance, forensics, and insider threat detection. Every access to sensitive data, every schema change, and every privileged action must be captured, protected from modification, and retained for the periods required by your regulatory frameworks. DBsafe provides query-level audit logging across all connected databases with tamper-evident storage and one-click compliance reports.

PCI DSS Req. 10
mandatory comprehensive database audit logging for all card-processing environments
HIPAA §164.312
audit controls required for all systems handling electronic PHI
12 months
minimum retention period for audit logs under PCI DSS and SOC 2
7 years
retention period for audit evidence under GDPR in some interpretations
The Challenge

You cannot investigate a breach without an audit trail

When a data breach is suspected, investigators need answers immediately: which data was accessed, by which account, from which IP address, over what time period, and using which application. Without a comprehensive audit trail, these questions cannot be answered — and without answers, breach notification obligations cannot be met, forensic investigation cannot proceed, and regulatory scrutiny cannot be deflected.

Database-native audit logging is often insufficient: it covers only specific query types, is easily disabled by database administrators, and typically lacks the retention and tamper-protection that compliance frameworks require.

The cost of inaction

PCI DSS Requirement 10 non-compliance: mandatory forensic investigation at £100,000+ per assessment

Inability to scope a breach within 72 hours: GDPR notification obligation defaults to notifying all affected individuals

HIPAA: inability to produce audit records in OCR investigation is itself a violation

Insider theft without audit trail: no forensic basis for civil or criminal action

The DBsafe Approach

How DBsafe implements comprehensive database auditing

01
01

Capture every database event

DBsafe logs every query, connection, privilege change, schema modification, and administrative action across all connected databases. No query type is excluded; no administrative activity is unlogged.

02
02

Protect logs from tampering

Audit logs are written to tamper-evident storage with cryptographic integrity protection. Database administrators cannot modify or delete logs, satisfying regulatory requirements for log integrity.

03
03

Retain and report for compliance

Configure retention periods by database and regulatory framework. Compliance-specific reports — formatted for PCI DSS Requirement 10, HIPAA Audit Controls, SOC 2 CC7, and ISO 27001 A.8.15 — are available on demand.

What database audit logging should capture

A comprehensive database audit trail captures: user authentication events (successful and failed logins), query execution (with the full query text, not just the statement type), row access counts, schema changes (CREATE, ALTER, DROP statements), privilege changes (GRANT and REVOKE statements), and administrative actions (backup operations, configuration changes).

DBsafe captures all of these with full context: the executing user, source IP address, application identifier where available, timestamp, database name, schema and table names, and the full query text. This context transforms a log entry from a data point into an investigable event.

Tamper-evident log storage

The value of an audit trail depends entirely on its integrity. A log that can be modified by a database administrator is worthless as compliance evidence and unreliable for forensic investigation. Regulatory frameworks including PCI DSS Requirement 10, HIPAA Audit Controls, and ISO 27001 A.8.15 all require that audit logs be protected from modification.

DBsafe stores audit logs in a separate, hardened storage environment that is inaccessible to database administrators of the monitored databases. Logs are written with cryptographic checksums that enable integrity verification. Any attempt to modify or delete a log record is itself logged and alerted.

Forensic investigation with audit trails

When an incident is suspected, investigators need to query the audit trail efficiently. DBsafe's audit log interface supports structured queries: find all access by a specific user in a time window, show all queries that touched a specific table, identify all accounts that accessed records for a specific individual, compare access patterns before and after a date.

These queries enable rapid scope determination for breach notifications and provide the forensic basis for internal investigations, regulatory responses, and, where necessary, civil or criminal proceedings.

Compliance-specific audit requirements

Different regulatory frameworks have different audit requirements. PCI DSS Requirement 10 specifies what must be logged (user access, object manipulation, use of root and administrative privileges, access attempts, use of authentication mechanisms, use of audit mechanisms, changes to audit mechanisms, creation and deletion of objects), how long logs must be retained (12 months minimum), and how logs must be protected.

DBsafe's compliance mode for PCI DSS captures exactly the events required by Requirement 10, retains them for the required period, and generates the log reports that QSAs review during assessments.

Alerting on suspicious database activity

An audit log that is only reviewed after an incident has limited value. DBsafe applies behavioural analysis to audit events in real time, identifying patterns that suggest malicious or anomalous activity: off-hours access to sensitive tables, bulk data exports from accounts that typically execute small queries, access from unusual IP addresses, and sequential table scanning patterns that match data exfiltration signatures.

Alerts are sent to SIEM systems, email, Slack, and PagerDuty. Alert thresholds are configurable per database and per user type.

Long-term log retention and regulatory requirements

Regulatory frameworks impose minimum log retention requirements that vary by framework and jurisdiction. PCI DSS requires 12 months. HIPAA requires 6 years for documentation. SOC 2 typically covers a 12-month audit period. GDPR's data retention rules can require audit logs that reference personal data processing to be retained for the duration of the processing and beyond.

DBsafe's retention management enables per-database retention policies aligned to the relevant regulatory requirements. Logs approaching retention limits are flagged for review before deletion.

Platform Capabilities

Everything you need to address database auditing — in one integrated platform.

Complete Query Capture

Log every SELECT, INSERT, UPDATE, DELETE, DDL, and administrative action across all databases.

Tamper-Evident Storage

Cryptographic integrity protection prevents modification or deletion of audit records.

Real-Time Alerting

Behavioural analysis flags suspicious patterns and sends alerts to SIEM and communication tools.

Forensic Query Interface

Structured queries across audit data for rapid incident scope determination.

Compliance Audit Reports

One-click reports formatted for PCI DSS Req. 10, HIPAA, SOC 2 CC7, and ISO 27001 A.8.15.

Configurable Retention

Per-database retention policies aligned to regulatory requirements from 12 months to 7 years.

Frequently Asked Questions

Answers to the most common questions about database auditing.

What is database auditing?

Database auditing is the process of recording and analysing all database activities — queries, connections, privilege changes, schema modifications, and administrative actions — in an immutable audit trail. It provides visibility into who did what with database data, enabling forensic investigation, compliance evidence, and insider threat detection.

Is native database audit logging sufficient for compliance?

Native database audit logging is often insufficient for compliance purposes. It typically lacks tamper protection (DBAs can modify or disable it), may not capture all required event types, and rarely provides the compliance-formatted reports that auditors require. Third-party audit solutions like DBsafe provide more comprehensive coverage with the integrity guarantees that compliance frameworks require.

How does DBsafe protect audit logs from tampering?

DBsafe writes audit logs to a separate storage environment inaccessible to administrators of the monitored databases. Cryptographic checksums are applied to log records at write time. Any modification to a log record breaks the checksum, flagging the tampering attempt. The integrity verification process is itself logged and alertable.

Can DBsafe audit logs be used as evidence in legal proceedings?

DBsafe's audit logs include cryptographic integrity verification, timestamps, and full attribution context. These properties make them suitable as documentary evidence in civil and criminal proceedings, subject to the specific rules of evidence in the relevant jurisdiction. Consult your legal counsel regarding admissibility requirements in your specific context.

What is the minimum retention period for database audit logs?

Retention requirements vary by framework. PCI DSS requires 12 months with 3 months immediately available for review. HIPAA requires 6 years for documentation. SOC 2 assessment periods are typically 12 months. GDPR audit logs should be retained in line with your documented retention policy. DBsafe allows per-database retention configuration to meet the most demanding applicable requirement.

Ready in 5 minutes

Implement comprehensive database audit logging today

DBsafe captures every database event from the moment you connect, building the tamper-evident audit trail that compliance and forensics require.