An activity log alert should fire when someone creates an Azure Policy assignment
This check looks for an Azure Monitor activity log alert rule that triggers on the creation of a policy assignment in the subscription. The safe setting is that such an alert exists, is enabled and notifies a person or team.
Why it matters
Azure Policy assignments decide which rules are applied to your subscriptions. Someone creating an assignment changes what is allowed or audited, so an unexpected one is worth a look. An alert turns that event into a message rather than a line in a log that nobody reads.
Azure Monitor activity log alert rules fire on events recorded in the activity log, and Microsoft documents a signal source named Activity log – Policy for policy-related events. See Create an activity log alert rule on Microsoft Learn.
In practice the alert is a cheap safety net: it does not stop anyone from assigning a policy, but it makes sure the right people hear about the change soon after it happens and can ask whether it was planned.
How to check it yourself
In the Azure portal open Monitor, then Alerts, then Alert rules. Filter to your subscription and look for an Activity log rule whose condition covers policy assignment creation (operation Microsoft.Authorization/policyAssignments/write) and is Enabled.
With Azure CLI, which only reads:
az monitor activity-log alert list --subscription "<subscription id>" --query "[].{name:name, enabled:enabled, conditions:condition.allOf}" -o jsonCheck that one rule contains the operation name above and that its action group reaches someone.
How to fix it
ConfigCobra only reads your Azure environment; the fix is yours to apply. In the portal choose Monitor, Alerts, + Create, Alert rule. Set the scope to the subscription, on the Condition tab pick Activity log, search for the signal Create policy assignment (Policy), attach an action group on the Actions tab, name the rule on Details, keep Enable alert rule upon creation ticked, then Review + create.
Or with the CLI:
az monitor action-group create --name ag-policy-changes --resource-group rg-monitoring --short-name policychg --action email owner owner@example.com
az monitor activity-log alert create --name alert-policy-assignment-created --resource-group rg-monitoring --scope /subscriptions/<subscription id> --condition category=Administrative and operationName=Microsoft.Authorization/policyAssignments/write --action-group ag-policy-changesWhat changes when you fix it
Nothing changes for workloads or users: the rule only watches the activity log. The people in the action group will start to receive a message each time a policy assignment is created, including planned ones from your own deployment pipelines, so agree who is expected to act on it.
The alert rule itself is a small Azure resource in the resource group you chose, so whoever creates it needs write permission there.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Microsoft Azure Foundations v6.0.0 | 6.1.2.1 | Level 1 |
More checks in Management and Governance Services
- Ensure that Resource Locks are set for Mission-Critical Azure ResourcesCIS 6.2
- Ensure that Azure Monitor Resource Logging is Enabled for All Services that Support itCIS 6.1.4
- Ensure that a 'Diagnostic Setting' Exists for Subscription Activity LogsCIS 6.1.1.1
- Ensure Diagnostic Setting Captures Appropriate CategoriesCIS 6.1.1.2
- Ensure the Storage Account Containing the Container with Activity Logs is Encrypted with Customer-managed Key (CMK)CIS 6.1.1.3
Go further
Check this on your Microsoft Azure
ConfigCobra runs this check with every other control of the CIS Microsoft Azure Benchmarks, read-only.