An attacker deletes diagnostic settings, flow logs or the Log Analytics workspace, sets Defender plans to the free tier, and deletes policy assignments or adds exemptions. The next steps then go unrecorded and unblocked. Remove the caller's access and recover the workspace first, then read the Activity Log directly for what happened during the gap.
The same changes when export to the workspace stopped: az monitor activity-log list --start-time <yyyy-mm-dd> --offset 7d --max-events 10000 --query "[?contains(operationName.value, 'delete') || contains(operationName.value, 'pricings/write') || contains(operationName.value, 'policyExemptions/write') || contains(operationName.value, 'alertsSuppressionRules/write')].{time:eventTimestamp, caller:caller, op:operationName.value}"
AuditLogs
Conditional Access policies changed or removed: Update Conditional Access policy and Delete Conditional Access policy
SecurityAlert
The Defender for Resource Manager defense evasion alert, AlertType, ARM_AnomalousOperation.DefenseEvasion
List deleted workspaces, which stay recoverable for 14 days: az monitor log-analytics workspace list-deleted-workspaces
3
Recover the deleted workspace: az monitor log-analytics workspace recover --workspace-name <workspace> --resource-group <rg>
4
Recreate the Activity Log export: az monitor diagnostic-settings subscription create --name <name> --workspace <workspace-id> --logs "[{category:Administrative,enabled:true},{category:Security,enabled:true},{category:Policy,enabled:true}]"
5
List the Defender plans and their tiers: az security pricing list
6
Restore each lowered plan. --tier alone restores no subplan or extensions, so compare with az security pricing show -n <plan> from your baseline and add --subplan and --extensions as needed: az security pricing create -n <plan> --tier standard
7
List policy assignments, including inherited ones, and recreate deleted ones: az policy assignment list --disable-scope-strict-match
8
Delete exemptions the attacker added destructive: az policy exemption delete --name <exemption> --scope <scope>
Eradicate and recover
#
Item
1
Compare each resource's diagnostic settings with your baseline: az monitor diagnostic-settings list --resource <resource-id>
2
Recreate deleted flow logs and Defender continuous export
3
Restore Conditional Access policies from your exported baseline
4
Lock the workspace and log storage accounts with CanNotDelete locks
5
Mark the logging gap in the timeline in T3 as unobserved time
Watch out
Deleting a diagnostic setting stops export only. Azure still keeps the Activity Log for 90 days, so read it directly.
A new diagnostic setting can take up to 90 minutes to deliver data. Count that time in the gap.
Microsoft Learn: Azure Monitor activity log, diagnostic settings, delete and recover a Log Analytics workspace, Entra audit log activity reference, resource provider operations, Azure CLI reference for az monitor activity-log, az monitor log-analytics workspace, az monitor diagnostic-settings, az security pricing and az policy. Checked October 2026. Defender for Cloud alerts for Resource Manager: checked October 2026.