Control: 4.1.1 Ensure that 'Auditing' is set to 'On'
It is recommended to enable auditing on SQL Servers. Enabling auditing at the server level ensures that all existing and newly created databases on the SQL server instance are audited. Auditing policy applied on the SQL database does not override auditing policy and settings applied on the particular SQL server where the database is hosted.
Auditing tracks database events and writes them to an audit log in the Azure storage account. It also helps to maintain regulatory compliance, understand database activity, and gain insight into discrepancies and anomalies that could indicate business concerns or suspected security violations.
Default setting for Auditing is set to Off.
- Login to Azure console and navigate to SQL Servers.
- For each server instance, go to Security section from left pane.
- Click on
Enable Azure SQL Auditingto On and select a storage account for log destination.
- Click Save.
- Get the list of all SQL Servers
- For each Server, enable auditing.
Set-AzureRmSqlServerAuditingPolicy -ResourceGroupName <resource group name> - ServerName <server name> -AuditType <audit type> -StorageAccountName <storage account name>
steampipe check azure_compliance.control.cis_v130_4_1_1
This control uses a named query:sql_server_auditing_on