Detection rules › Kusto
Snowflake - Multiple failed queries
'Detects multiple failed queries in short timeframe.'
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery | T1082 System Information Discovery, T1518 Software Discovery |
Rule body kusto
id: 5f8a81d9-7d27-4ff5-a0ce-4285ee02c2c8
name: Snowflake - Multiple failed queries
description: |
'Detects multiple failed queries in short timeframe.'
severity: High
status: Available
requiredDataConnectors:
- connectorId: Snowflake
dataTypes:
- Snowflake
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
- Discovery
relevantTechniques:
- T1518
- T1082
query: |
let threshold = 50;
Snowflake
| where isnotempty(QueryExecutionStatus)
| where QueryExecutionStatus !~ 'SUCCESS'
| summarize count() by TargetUsername, bin(TimeGenerated, 5m)
| where count_ > threshold
| extend AccountCustomEntity = TargetUsername
entityMappings:
- entityType: Account
fieldMappings:
- identifier: Name
columnName: AccountCustomEntity
version: 1.0.3
kind: Scheduled
Stages and Predicates
Parameters
let threshold = 50;
Stage 1: source
Snowflake
Stage 2: where
| where isnotempty(QueryExecutionStatus)
Stage 3: where
| where QueryExecutionStatus !~ 'SUCCESS'
Stage 4: summarize
| summarize count() by TargetUsername, bin(TimeGenerated, 5m)
Stage 5: where
| where count_ > threshold
Stage 6: extend
| extend AccountCustomEntity = TargetUsername
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
QueryExecutionStatus | is_not_null | |
QueryExecutionStatus | ne |
|
count_ | gt |
|
Output fields
Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.
| Field | Source |
|---|---|
TargetUsername | summarize |
AccountCustomEntity | extend |