PIVTR-D
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

LogSearch for
AzureActivityNew 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 GraphVMs 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
SecurityAlertThe creation alert ARM_SuspiciousComputeCreation, and the Defender for Servers alert Digital currency mining related behavior detected for mining inside a VM
Scale setsScale 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
AutoscaleAutoscale settings that would scale the attacker's scale sets out again: az monitor autoscale list --resource-group <rg>
Cost ManagementCost by region and meter for the incident window. Anomaly alerts, if configured, often show the start time

Contain

#Item
1Remove the caller's access using service principal credential leak or account takeover
2Snapshot the OS disk of one attacker VM for analysis
3Deallocate attacker VMs to stop compute charges: az vm deallocate --ids <vm-id> <vm-id>
4Deallocate attacker scale sets: az vmss deallocate --name <vmss> --resource-group <rg>
5Where autoscale could add instances, set the scale set capacity to zero as well: az vmss scale --name <vmss> --resource-group <rg> --new-capacity 0
6Deny 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
1List everything in each unused region and enter it in the evidence register: az resource list --location <region>
2Delete attacker resources and resource groups after the register lists them destructive
3Check approved-region VMs for new extensions and run commands from the same caller
4Review quota increase requests raised in the window and lower the quotas
5Set 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.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.