The subscription activity log diagnostic setting should capture the categories that record changes and security events
This check looks at the diagnostic setting that exports the Azure activity log for a subscription and which log categories it includes. The safe setting is an export that captures the categories recording administrative changes, security events, policy decisions and alerts, not a partial selection.
Why it matters
The activity log records control-plane operations on a subscription, such as who created, changed or deleted a resource. Microsoft explains that it is collected automatically but kept only for a limited time unless you send it elsewhere with a diagnostic setting (Azure activity log). An export that exists but leaves out categories still leaves blind spots, for example missing the security or policy events you would look for after an incident.
Choosing categories on purpose is the point of this check: the setting is easy to create once and forget, so a half-complete selection can sit unnoticed for years.
How to check it yourself
In the Azure portal go to Monitor > Activity log > Export Activity Logs (also reachable from Diagnostic settings on the Monitor menu with the subscription scope). Open each setting and read which categories are ticked and where they go.
Read-only with Azure CLI, using the subscription-scope command that Microsoft documents for the activity log:
az monitor diagnostic-settings subscription list --subscription Look at the logs array in the output. Categories you expect to see include Administrative, Security, Policy and Alert, each with enabled: true. A missing category or an empty list fails the check.
How to fix it
In Export Activity Logs choose Add diagnostic setting, tick the categories to capture, and select a destination such as a Log Analytics workspace or a storage account. Microsoft notes the activity log cannot be configured with the PowerShell resource cmdlet; use the portal, CLI or a template instead.
az monitor diagnostic-settings subscription create --name activity-to-workspace \
--subscription \
--workspace \
--logs '[{"category":"Administrative","enabled":true},{"category":"Security","enabled":true},{"category":"Policy","enabled":true},{"category":"Alert","enabled":true}]' Use update instead of create if a setting already exists. ConfigCobra reads your subscription only and never applies these changes; run the command yourself, first on a test subscription.
What changes when you fix it
End users see no difference. The people affected are the platform and security teams: the chosen destination now receives more activity events, which can raise storage or workspace cost depending on the volume, so size the retention to what you actually investigate.
Anyone with read access to the destination can see who changed what in the subscription, so check the permissions on the workspace or storage account. If an existing setting is edited rather than replaced, downstream queries and alerts that read from it keep working and simply see additional categories. Check the existing settings first and edit one rather than adding a duplicate.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Microsoft Azure Foundations v6.0.0 | 6.1.1.2 | Level 1 |
Go further
Check this on your Microsoft Azure
ConfigCobra runs this check with every other control of the CIS Microsoft Azure Benchmarks, read-only.