Azure CloudShell Usage
Description
'This query look for users starting an Azure CloudShell session and summarizes the Azure Activity from that user account during that timeframe (by default 1 hour). This can be used to help identify abuse of the CloudShell to modify Azure resources.'
Query · kql
AzureActivity
| where ActivityStatusValue =~ "Success"
| where ResourceGroup has "cloud-shell-storage"
| where OperationNameValue =~ "Microsoft.Storage/storageAccounts/listKeys/action"
// Change the timekey scope below to get activity for a longer window
| summarize by Caller, timekey= bin(TimeGenerated, 1h)
| join (AzureActivity | where TimeGenerated >= ago(1d)
| where OperationNameValue !~ "Microsoft.Storage/storageAccounts/listKeys/action"
| where isnotempty(OperationNameValue)
// Change the timekey scope below to get activity for a longer window
| summarize make_set(OperationNameValue) by Caller, timekey=bin(TimeGenerated, 1h)) on Caller, timekey
| extend timestamp = timekey, AccountCustomEntity = Caller