RAzure playbook · Data and storage
Storage exposed or data exfiltrated
An attacker turns on anonymous access to a container, lists the storage account keys, or generates shared access signature (SAS) tokens, then downloads blobs in bulk. A SAS signed with an account key keeps working after the attacker loses their Azure role. Block anonymous access and rotate both keys first, then revoke user delegation SAS as well.
Look here
| Log | Search for |
|---|---|
| AzureActivity | Key listing, SAS generation, key regeneration and access changes. The operations sit under Microsoft.Storage/storageAccounts: listKeys/action, listAccountSas/action, listServiceSas/action, regeneratekey/action, write and blobServices/containers/write. Query them: AzureActivity | where OperationNameValue has "Microsoft.Storage/storageAccounts" | project TimeGenerated, Caller, CallerIpAddress, OperationNameValue, _ResourceId |
| StorageBlobLogs | Container access changes, then bulk reads by authentication type. User delegation key requests are data-plane calls, so they appear here and never in AzureActivity. Search SetContainerACL, then ListBlobs and GetBlob by AuthenticationType (Anonymous, SAS, AccountKey, OAuth): StorageBlobLogs | where OperationName in ("GetBlob", "ListBlobs") | summarize Requests=count(), Bytes=sum(ResponseBodySize) by AccountName, CallerIpAddress, AuthenticationType, AuthenticationHash | order by Bytes desc |
| Account settings now | Anonymous access, Shared Key and public network settings across a subscription: az storage account list --query "[].{name:name, rg:resourceGroup, publicBlob:allowBlobPublicAccess, sharedKey:allowSharedKeyAccess, network:publicNetworkAccess}" -o table |
| Containers now | Containers with anonymous access in one account: az storage container list --account-name <account> --auth-mode login --query "[?properties.publicAccess].{name:name, access:properties.publicAccess}" -o table |
| SecurityAlert | Defender for Storage exposure and exfiltration alerts: SecurityAlert | where AlertType in ("Storage.Blob_OpenACL", "Storage.Blob_AnonymousAccessAnomaly", "Storage.Blob_DataExfiltration.AmountOfDataAnomaly", "Storage.Blob_AccountSas.UnusualExternalAccess") | project TimeGenerated, AlertName, AlertType, CompromisedEntity |
Contain
| # | Item |
|---|---|
| 1 | Block anonymous access for the whole account, then test from an unauthenticated client: az storage account update --name <account> --resource-group <rg> --allow-blob-public-access false |
| 2 | Rotate the primary key, which revokes account and service SAS signed with it: az storage account keys renew -g <rg> -n <account> --key primary |
| 3 | Rotate the secondary key after clients move to the new primary key: az storage account keys renew -g <rg> -n <account> --key secondary |
| 4 | Revoke every user delegation SAS: az storage account revoke-delegation-keys --name <account> --resource-group <rg> |
| 5 | Block Shared Key and key-signed SAS after the app owners confirm impact: az storage account update --name <account> --resource-group <rg> --allow-shared-key-access false |
| 6 | Remove the caller's roles on the account: az role assignment delete --ids <assignment-id> |
| 7 | Close public network access where no external client needs it: az storage account update --name <account> --resource-group <rg> --public-network-access Disabled |
Eradicate and recover
| # | Item |
|---|---|
| 1 | Check container access levels, stored access policies and lifecycle policy changes (managementPolicies/write) on every account the caller could reach |
| 2 | Turn on blob logging where missing: az monitor diagnostic-settings create --name <name> --resource <account-id>/blobServices/default --workspace <workspace-id> --logs "[{category:StorageRead,enabled:true},{category:StorageWrite,enabled:true},{category:StorageDelete,enabled:true}]" |
| 3 | List the blobs read and bytes returned per caller, and give the list to the Legal advisor for notification deadlines |
| 4 | Distribute new keys or SAS only to known clients |
| 5 | Assign an Azure Policy that audits allowBlobPublicAccess across subscriptions |
Watch out
- SAS tokens never appear in logs. Only the SHA-256 hash of the signature in
AuthenticationHashties requests to one token. - Key rotation leaves user delegation SAS valid. Run step 4 as well.
Microsoft Learn: StorageBlobLogs table, resource provider operations for Storage, Azure CLI reference for az storage account, az storage container and az monitor diagnostic-settings. Checked October 2026. Defender for Cloud alerts for Storage: checked October 2026.