RAzure playbook · Compute and containers
Resource hijacking
An attacker with Contributor rights creates virtual machines (VMs) or scale sets, often GPU sizes, in regions the organization never uses, and requests quota increases to run more of them. Remove the caller's access and deallocate the attacker's compute first, because charges grow every hour it runs.
Look here
| Log | Search for |
|---|---|
| AzureActivity | New VMs, scale sets and resource groups, quota increases and support tickets, by caller: AzureActivity | where OperationNameValue in~ ("Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachineScaleSets/write", "Microsoft.Resources/subscriptions/resourceGroups/write", "Microsoft.Quota/quotas/write", "Microsoft.Capacity/resourceProviders/locations/serviceLimits/write", "Microsoft.Support/supportTickets/write") | summarize count() by Caller, CallerIpAddress, OperationNameValue, ResourceGroup |
| Azure Resource Graph | VMs and scale sets by region across subscriptions: az graph query -q "Resources | where type in~ ('microsoft.compute/virtualmachines', 'microsoft.compute/virtualmachinescalesets') | summarize count() by location, subscriptionId" --first 1000 |
| SecurityAlert | The creation alert ARM_SuspiciousComputeCreation, and the Defender for Servers alert Digital currency mining related behavior detected for mining inside a VM |
| Scale sets | Scale sets with their region, size and capacity: az vmss list --query "[].{name:name, rg:resourceGroup, location:location, sku:sku.name, capacity:sku.capacity}" -o table |
| Autoscale | Autoscale settings that would scale the attacker's scale sets out again: az monitor autoscale list --resource-group <rg> |
| Cost Management | Cost by region and meter for the incident window. Anomaly alerts, if configured, often show the start time |
Contain
| # | Item |
|---|---|
| 1 | Remove the caller's access using service principal credential leak or account takeover |
| 2 | Snapshot the OS disk of one attacker VM for analysis |
| 3 | Deallocate attacker VMs to stop compute charges: az vm deallocate --ids <vm-id> <vm-id> |
| 4 | Deallocate attacker scale sets: az vmss deallocate --name <vmss> --resource-group <rg> |
| 5 | Where autoscale could add instances, set the scale set capacity to zero as well: az vmss scale --name <vmss> --resource-group <rg> --new-capacity 0 |
| 6 | Deny new resources outside approved regions with the built-in Allowed locations policy: az policy assignment create --name allowed-locations --policy e56962a6-4747-49cd-b67b-bf8b01975c4c --scope <scope> --params "{ 'listOfAllowedLocations': { 'value': [ '<region>' ] } }" |
Eradicate and recover
| # | Item |
|---|---|
| 1 | List everything in each unused region and enter it in the evidence register: az resource list --location <region> |
| 2 | Delete attacker resources and resource groups after the register lists them destructive |
| 3 | Check approved-region VMs for new extensions and run commands from the same caller |
| 4 | Review quota increase requests raised in the window and lower the quotas |
| 5 | Set budget alerts on every subscription, including the regions the attack used |
Watch out
- The Allowed locations policy excludes resource groups and resources in the global region.
- A VM stopped from inside its operating system stays allocated and keeps billing for compute. Deallocate it.
- Deallocation discards memory. Capture it first from any VM you need to analyze, per evidence.
Microsoft Learn: resource provider operations for Compute, Quota, Capacity and Support; Resource Graph query samples; Azure CLI reference for az vm, az vmss, az monitor autoscale, az policy assignment and az resource. Azure Policy built-in definitions repository: Allowed locations. Checked October 2026. Defender for Cloud alerts for Resource Manager and Linux machines: checked October 2026.