Complete Guide For SQL Database Audit
Complete Guide For SQL Database Audit
Auditing an instance of the SQL Server Database Engine or an individual database involves tracking and logging events that occur on the Database Engine. SQL Server audit lets you create server audits, which can contain server audit specifications for server level events, and database audit specifications for database level events. There are several levels of auditing for SQL Server, depending on government or standards requirements for your installation. You can record server audit action groups per-instance, and either database audit action groups or database audit actions per database. The audit event will occur every time that the auditable action is encountered. All editions of SQL Server support server level audits. Database level auditing is limited to Enterprise, Developer, and Evaluation editions.
http://www.sql-programmers.com/sql-database-audit.aspx
Enable future accountability for current actions taken in a particular schema, table, row or affecting specific content Deter users from inappropriate actions based on that accountability Investigate suspicious activity Notify an auditor that an unauthorized user is manipulating or deleting data and that the user has more privileges than expected which can lead to reassessing user authorizations Monitor and gather data about specific database activities
http://www.sql-programmers.com/sql-database-audit.aspx
http://www.sql-programmers.com/sql-database-audit.aspx
http://www.sql-programmers.com/sql-database-audit.aspx
TARGET
The results of an audit are sent to a target, which can be a file, the Windows Security event log, or the Windows Application event log. Logs must be reviewed and archived periodically to make sure that the target has sufficient space to write additional records When you are saving audit information to a file, to help prevent tampering, you can restrict access to the file location in the following ways: The SQL Server Service Account must have both Read and Write permission. Audit Administrators typically require Read and Write permission. This assumes that the Audit Administrators are Windows accounts for administration of audit files, such as: copying them to different shares, backing them up, and so on. Audit Readers that are authorized to read audit files must have Read permission
http://www.sql-programmers.com/sql-database-audit.aspx
The mirror server must have an audit with the same GUID to enable the database audit specification to write audit records. This can be configured by using the command CREATE AUDIT WITH GUID= <GUID from source Server Audit>. For binary file targets, the mirror server service account must have appropriate permissions to the location where the audit trail is being written. For Windows event log targets, the security policy on the computer where the mirror server is located must allow for service account access to the security or application event log.
http://www.sql-programmers.com/sql-database-audit.aspx
DDL STATEMENTS
You can use the following DDL statements to create, alter, and drop audit specifications:
ALTER AUTHORIZATION ALTER DATABASE AUDIT SPECIFICATION ALTER SERVER AUDIT ALTER SERVER AUDIT SPECIFICATION CREATE DATABASE AUDIT SPECIFICATION CREATE SERVER AUDIT CREATE SERVER AUDIT SPECIFICATION DROP DATABASE AUDIT SPECIFICATION DROP SERVER AUDIT DROP SERVER AUDIT SPECIFICATION
http://www.sql-programmers.com/sql-database-audit.aspx
http://www.sql-programmers.com/sql-database-audit.aspx
Description
Contains information about the database audit specifications in a SQL Server audit on a server instance.
sys.database_audit_specification_de Contains information about the database audit specifications in a tails SQL Server audit on a server instance for all databases.
sys.server_audits
sys.server_audit_specifications
Contains one row for each SQL Server audit in a server instance.
Contains information about the server audit specifications in a SQL Server audit on a server instance.
sys.server_audit_specifications_detai Contains information about the server audit specification details ls (actions) in a SQL Server audit on a server instance. sys.server_file_audits Contains stores extended information about the file audit type in a SQL Server audit on a server instance.
http://www.sql-programmers.com/sql-database-audit.aspx
PERMISSIONS
Each feature and command for SQL Server Audit has individual permission requirements. Unless otherwise specified, viewing catalog views requires a principal to have one of the following:
Membership in the sysadmin fixed server role The CONTROL SERVER permission The VIEW SERVER STATE permission The ALTER ANY AUDIT permission The VIEW AUDIT STATE permission (gives only the principal access to the sys.server_audits catalog view)
http://www.sql-programmers.com/sql-database-audit.aspx
PERMISSIONS contd
Principals in the sysadmin role can tamper with any audit component and those in the db_owner role can tamper with audit specifications in a database. SQL Server Audit will validate that a logon that creates or alters an audit specification has at least the ALTER ANY DATABASE AUDIT permission. However, it does no validation when you attach a database. You should assume all Database Audit Specifications are only as trustworthy as those principals in the sysadmin or db_owner role.
http://www.sql-programmers.com/sql-database-audit.aspx
THANK YOU !
http://www.sql-programmers.com