KQLHunting query: tune before alertingCloud AI abuse: Azure OpenAI, Vertex AI, self-hosted
Azure OpenAI / AI Foundry account keys listed by a new caller
API keys for Azure OpenAI and other Cognitive Services accounts are read with Microsoft.CognitiveServices/accounts/listKeys/action. Storm-2139 used customer credentials scraped from public sources to reach generative AI services and resell access. This hunt lists callers that listed keys in the last day but not in the previous two weeks.
- Log source
- Microsoft Sentinel / Log Analytics: AzureActivity
- Techniques
- AML.T0055 Unsecured Credentials · AML.T0012 Valid Accounts · LLM10 Unbounded Consumption · AML.T0034 Cost Harvesting
- MITRE ATT&CK
- T1078.004Cloud AccountsT1496.004Cloud Service Hijacking
- Reviewed
- 2026-11-10
Query
let lookback = 14d;
let recent = 1d;
let op = "Microsoft.CognitiveServices/accounts/listKeys/action";
let known_callers = AzureActivity
| where TimeGenerated between (ago(lookback) .. ago(recent))
| where OperationNameValue =~ op
| distinct Caller;
AzureActivity
| where TimeGenerated > ago(recent)
| where OperationNameValue =~ op
| where ActivityStatusValue in~ ("Succeeded", "Success")
| where Caller !in (known_callers)
| summarize Calls = count(), Accounts = make_set(_ResourceId, 50), CallerIPs = make_set(CallerIpAddress, 20),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by Caller, SubscriptionId
| order by Calls desc Expected false positives
- New deployment pipelines or engineers onboarding to an AI project
- Key rotation automation and secret-sync tools (for example Key Vault sync jobs)
Sources
- Azure docs: Microsoft.CognitiveServices resource provider operations
- Azure Monitor: AzureActivity table reference
- Microsoft: Disrupting a global cybercrime network abusing generative AI (Storm-2139, Feb 2025)
- SigmaHQ: Rare Subscription-level Operations In Azure (includes CognitiveServices listKeys)
Reviewed against vendor documentation, not tested in your environment. Defensive use only.