You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/sql-database/sql-database-auditing.md
+25-48Lines changed: 25 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,14 +33,7 @@ You can use SQL database auditing to:
33
33
-**Analyze** reports. You can find suspicious events, unusual activity, and trends.
34
34
35
35
> [!IMPORTANT]
36
-
> Audit logs are written to **Append Blobs** in Azure Blob storage on your Azure subscription.
37
-
>
38
-
> - All storage kinds (v1, v2, blob) are supported.
39
-
> - All storage replication configurations are supported.
40
-
> - Storage behind a virtual network and firewall is supported.
41
-
> -**Premium storage** is currently **not supported**.
42
-
> -**Hierarchical namespace** for **Azure Data Lake Storage Gen2 storage account** is currently **not supported**.
43
-
> - Enabling auditing on a paused **Azure SQL Data Warehouse** is not supported. To enable auditing, resume the Data Warehouse.
36
+
> - Azure SQL Database auditing is optimized for availability & performance. During very high activity Azure SQL Database allows operations to proceed and may not record some audited events.
44
37
45
38
## <aid="subheading-8"></a>Define server-level vs. database-level auditing policy
46
39
@@ -54,7 +47,7 @@ An auditing policy can be defined for a specific database or as a default server
54
47
55
48
> [!NOTE]
56
49
> You should avoid enabling both server blob auditing and database blob auditing together, unless:
57
-
> - You want to use a different *storage account* or *retention period* for a specific database.
50
+
> - You want to use a different *storage account*, *retention period* or *Log Analytics Workspace* for a specific database.
58
51
> - You want to audit event types or categories for a specific database that differ from the rest of the databases on the server. For example, you might have table inserts that need to be audited only for a specific database.
59
52
>
60
53
> Otherwise, we recommended that you enable only server-level blob auditing and leave the database-level auditing disabled for all databases.
@@ -63,9 +56,6 @@ An auditing policy can be defined for a specific database or as a default server
63
56
64
57
The following section describes the configuration of auditing using the Azure portal.
65
58
66
-
> [!NOTE]
67
-
>You now have multiple options for configuring where audit logs are written. You can write logs to an Azure storage account, to a Log Analytics workspace for consumption by Azure Monitor logs, or to event hub for consumption using event hub. You can configure any combination of these options, and audit logs will be written to each.
68
-
69
59
1. Go to the [Azure portal](https://portal.azure.com).
70
60
2. Navigate to **Auditing** under the Security heading in your SQL database/server pane.
71
61
3. If you prefer to set up a server auditing policy, you can select the **View server settings** link on the database auditing page. You can then view or modify the server auditing settings. Server auditing policies apply to all existing and newly created databases on this server.
@@ -74,9 +64,7 @@ The following section describes the configuration of auditing using the Azure po
74
64
75
65
4. If you prefer to enable auditing on the database level, switch **Auditing** to **ON**. If server auditing is enabled, the database-configured audit will exist side-by-side with the server audit.
76
66
77
-
![Navigation pane][3]
78
-
79
-
5.**New** - You now have multiple options for configuring where audit logs will be written. You can write logs to an Azure storage account, to a Log Analytics workspace for consumption by Azure Monitor logs, or to event hub for consumption using event hub. You can configure any combination of these options, and audit logs will be written to each.
67
+
5. You have multiple options for configuring where audit logs will be written. You can write logs to an Azure storage account, to a Log Analytics workspace for consumption by Azure Monitor logs (preview), or to event hub for consumption using event hub (preview). You can configure any combination of these options, and audit logs will be written to each.
@@ -85,9 +73,28 @@ The following section describes the configuration of auditing using the Azure po
85
73
To configure writing audit logs to a storage account, select **Storage** and open **Storage details**. Select the Azure storage account where logs will be saved, and then select the retention period. Then click **OK**. Logs older than the retention period are deleted.
86
74
87
75
> [!IMPORTANT]
76
+
> - All storage kinds (v1, v2, blob) are supported.
77
+
> - All storage replication configurations are supported.
78
+
> - Storage behind a virtual network and firewall is supported.
79
+
> -**Premium storage** is currently **not supported**.
80
+
> -**Hierarchical namespace** for **Azure Data Lake Storage Gen2 storage account** is currently **not supported**.
81
+
> - Enabling auditing on a paused **Azure SQL Data Warehouse** is not supported. To enable auditing, resume the Data Warehouse.
82
+
>
88
83
> - The default value for retention period is 0 (unlimited retention). You can change this value by moving the **Retention (Days)** slider in **Storage settings** when configuring the storage account for auditing.
89
-
> - If you change retention period from 0 (unlimited retention) to any other value, please note that retention will only apply to logs written after retention value was changed (logs written during the period when retention was set to unlimited are preserved, even after retention is enabled)
90
-
> - Customer wishing to configure an immutable log store for their server- or database-level audit events should follow the [instructions provided by Azure Storage](https://docs.microsoft.com/azure/storage/blobs/storage-blob-immutability-policies-manage#enabling-allow-protected-append-blobs-writes) (Please ensure you have selected **Allow selected Appends** when you configure the immutable blob storage)
84
+
> If you change retention period from 0 (unlimited retention) to any other value, please note that retention will only apply to logs written after retention value was changed (logs written during the period when retention was set to unlimited are preserved, even after retention is enabled)
85
+
> - Customer wishing to configure an immutable log store for their server- or database-level audit events should follow the [instructions provided by Azure Storage](https://docs.microsoft.com/azure/storage/blobs/storage-blob-immutability-policies-manage#enabling-allow-protected-append-blobs-writes) (Please ensure you have selected **Allow additional appends** when you configure the immutable blob storage)
86
+
> - After you've configured your auditing settings, you can turn on the new threat detection feature and configure emails to receive security alerts. When you use threat detection, you receive proactive alerts on anomalous database activities that can indicate potential security threats. For more information, see [Getting started with threat detection](sql-database-threat-detection-get-started.md).
87
+
> - For details about the log format, hierarchy of the storage folder and naming conventions, see the [Blob Audit Log Format Reference](https://go.microsoft.com/fwlink/?linkid=829599).
88
+
> - Azure SQL Database Audit stores 4000 characters of data for character fields in an audit record. When the **statement** or the **data_sensitivity_information** values returned from an auditable action contain more than 4000 characters, any data beyond the first 4000 characters will be **truncated and not audited**.
89
+
> - Audit logs are written to **Append Blobs** in an Azure Blob storage on your Azure subscription
90
+
> - The default auditing policy includes all actions and the following set of action groups, which will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
91
+
>
92
+
> BATCH_COMPLETED_GROUP<br>
93
+
> SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP<br>
94
+
> FAILED_DATABASE_AUTHENTICATION_GROUP<br>
95
+
>
96
+
> You can configure auditing for different types of actions and action groups using PowerShell, as described in the [Manage SQL database auditing using Azure PowerShell](#subheading-7) section.
97
+
> - When using AAD Authentication, failed logins records will *not* appear in the SQL audit log. To view failed login audit records, you need to visit the [Azure Active Directory portal](../active-directory/reports-monitoring/reference-sign-ins-error-codes.md), which logs details of these events.
@@ -106,11 +113,9 @@ To configure writing audit logs to a Log Analytics workspace, select **Log Analy
106
113
107
114
### <aid="audit-event-hub-destination">Audit to Event Hub destination</a>
108
115
109
-
> [!IMPORTANT]
110
-
> Enabling auditing on a paused SQL pool is not possible. To enable it, un-pause the SQL pool.
111
-
112
116
> [!WARNING]
113
117
> Enabling auditing on a server that has a SQL pool on it **results in the SQL pool being resumed and re-paused again** which may incur billing charges.
118
+
> Enabling auditing on a paused SQL pool is not possible. To enable it, un-pause the SQL pool.
114
119
115
120
To configure writing audit logs to an event hub, select **Event Hub (Preview)** and open **Event Hub details**. Select the event hub where logs will be written and then click **OK**. Be sure that the event hub is in the same region as your database and server.
116
121
@@ -219,34 +224,6 @@ In production, you are likely to refresh your storage keys periodically. When wr
219
224
3. Go back to the auditing configuration page, switch the storage access key from secondary to primary, and then click **OK**. Then click **Save** at the top of the auditing configuration page.
220
225
4. Go back to the storage configuration page and regenerate the secondary access key (in preparation for the next key's refresh cycle).
221
226
222
-
## Additional Information
223
-
224
-
- If you want to customize the audited events, you can do this via [PowerShell cmdlets](#subheading-7) or the [REST API](#subheading-9).
225
-
226
-
- After you've configured your auditing settings, you can turn on the new threat detection feature and configure emails to receive security alerts. When you use threat detection, you receive proactive alerts on anomalous database activities that can indicate potential security threats. For more information, see [Getting started with threat detection](sql-database-threat-detection-get-started.md).
227
-
- For details about the log format, hierarchy of the storage folder and naming conventions, see the [Blob Audit Log Format Reference](https://go.microsoft.com/fwlink/?linkid=829599).
228
-
229
-
> [!IMPORTANT]
230
-
> Azure SQL Database Audit stores 4000 characters of data for character fields in an audit record. When the **statement** or the **data_sensitivity_information** values returned from an auditable action contain more than 4000 characters, any data beyond the first 4000 characters will be **truncated and not audited**.
231
-
232
-
- Audit logs are written to **Append Blobs** in an Azure Blob storage on your Azure subscription:
233
-
-**Premium Storage** is currently **not supported** by Append Blobs.
234
-
235
-
- The default auditing policy includes all actions and the following set of action groups, which will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
236
-
237
-
BATCH_COMPLETED_GROUP<br>
238
-
SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP<br>
239
-
FAILED_DATABASE_AUTHENTICATION_GROUP
240
-
241
-
You can configure auditing for different types of actions and action groups using PowerShell, as described in the [Manage SQL database auditing using Azure PowerShell](#subheading-7) section.
242
-
243
-
- When using AAD Authentication, failed logins records will *not* appear in the SQL audit log. To view failed login audit records, you need to visit the [Azure Active Directory portal](../active-directory/reports-monitoring/reference-sign-ins-error-codes.md), which logs details of these events.
244
-
245
-
- Azure SQL Database auditing is optimized for availability & performance. During very high activity Azure SQL Database allows operations to proceed and may not record some audited events.
246
-
247
-
- For configuring Immutable Auditing on storage account, see [Allow protected append blobs writes](../storage/blobs/storage-blob-immutable-storage.md#allow-protected-append-blobs-writes). Please note that the container name for Auditing is **sqldbauditlogs**.
248
-
249
-
250
227
## <aid="subheading-7"></a>Manage Azure SQL Server and Database auditing using Azure PowerShell
251
228
252
229
**PowerShell cmdlets (including WHERE clause support for additional filtering)**:
0 commit comments