Azure Log Analytic Table Operation Audit
Query
//For auditing Write/Delete actions upon LAW Tables
AzureActivity
| where TimeGenerated > ago(90d)
| where OperationNameValue contains "MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/TABLES/"
| extend TableName = Properties_d.resource
| project-reorder TimeGenerated, TableName, CallerExplanation
This query is designed to audit write and delete actions on Azure Log Analytics Workspace (LAW) tables. Here's a simple breakdown of what it does:
-
Data Source: It uses the
AzureActivitytable, which logs various activities in Azure. -
Time Filter: It filters the data to include only activities that have occurred in the last 90 days.
-
Operation Filter: It looks for operations related to LAW tables by checking if the
OperationNameValuecontains the specific string "MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/TABLES/". This string indicates actions performed on LAW tables. -
Extract Table Name: It creates a new column called
TableNameby extracting the resource information from theProperties_dfield, which likely contains details about the specific table being acted upon. -
Select and Order Columns: Finally, it selects and orders the columns to display
TimeGenerated,TableName, andCaller. This helps in easily identifying when the action took place, which table was affected, and who performed the action.
In summary, this query helps track who has been writing to or deleting from LAW tables over the past 90 days, providing a clear view of these activities for auditing purposes.