← Back to SOC feed Coverage →

User running multiple queries that fail

kql MEDIUM Azure-Sentinel
T1020
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-04-24T09:00:00Z · Confidence: medium

Hunt Hypothesis

Users attempting to execute multiple failed queries in a short timeframe may be probing for specific data or testing credentials, indicating potential reconnaissance or credential stuffing activities. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify early signs of adversarial activity and prevent further compromise.

KQL Query


let timeframe = 1h;
let threshold = 10;
LAQueryLogs
| where ResponseCode != 200
| summarize count() by AADEmail, bin(TimeGenerated, timeframe)
| where count_ > threshold
| join kind=rightsemi (
LAQueryLogs
| summarize make_set(QueryText) by AADEmail, bin(TimeGenerated, timeframe))
on AADEmail, TimeGenerated
| extend timestamp = TimeGenerated, AccountCustomEntity = AADEmail

Analytic Rule Definition

id: a2fca6ac-1155-4eec-934b-65aa62cdbb09
name: User running multiple queries that fail
description: |
  'This hunting query looks for users who have multiple failed queries in a short space of time.'
requiredDataConnectors:
  - connectorId: AzureMonitor(Query Audit)
    dataTypes:
      - LAQueryLogs
tactics:
  - Exfiltration
relevantTechniques:
  - T1020
query: |

  let timeframe = 1h;
  let threshold = 10;
  LAQueryLogs
  | where ResponseCode != 200
  | summarize count() by AADEmail, bin(TimeGenerated, timeframe)
  | where count_ > threshold
  | join kind=rightsemi (
  LAQueryLogs
  | summarize make_set(QueryText) by AADEmail, bin(TimeGenerated, timeframe))
  on AADEmail, TimeGenerated
  | extend timestamp = TimeGenerated, AccountCustomEntity = AADEmail
version: 1.0.0
metadata:
    source:
        kind: Community
    author:
        name: Pete Bryan
    support:
        tier: Microsoft
    categories:
        domains: [ "Security - Threat Protection" ]

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/LAQueryLogs/UserRunningMultipleQueriesThatFail.yaml