liveBook · Manning

SQL Server audit

As explained in 100 SQL Server Mistakes and How to Avoid Them

SQL Server Audit is a SQL Server feature that records specified database and server events for review and compliance.

Treating privileged activity as inherently trustworthy is a security mistake. DBAs, contractors, managed-service staff, or compromised administrative accounts can alter systems, so every privileged action needs accountability and rapid investigation. section 14.5

SQL Server Audit provides lightweight auditing for server and database events. Writing results to the Windows security log helps prevent SQL Server administrators, including sysadmins, from tampering with the record. section 14.5

Before relying on a tamper-resistant administrative audit:

  • Enable application-generated audit events through auditpol. section 14.5
  • Grant the SQL Server service account the Generate Security Audits user right in secpol.msc. section 14.5
  • Configure success and failure auditing for the audit-object policy, then restart the server. section 14.5

Named scenario: AdminActivityAudit

Create an audit that writes to SECURITY_LOG and specifies failure behavior, then attach an audit specification covering role-member changes, audit changes, DBCC, permission changes, impersonation, object changes, configuration operations, and server-state changes.

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains Windows prerequisites, restart timing, audit destinations, failure handling, and selected server audit action groups.
Examples
Demonstrates SECURITY_LOG output and an administrative specification covering configuration, permission, impersonation, DBCC, and state changes.
What it assumes
Assumes access to Windows audit policy tools, secpol.msc, and the SQL Server instance requiring administrative auditing.
What you can do after
Operate/configure SQL Server Audit with Windows prerequisites and targeted administrative event specifications.
How it connects
Connects SQL Server Audit with nonrepudiation, Windows security logging, privileged access, and incident response.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.