Detection rules › Kusto

Snowflake - Multiple failed queries

Status
available
Severity
high
Time window
5m
Group by
TargetUsername
Source
github.com/Azure/Azure-Sentinel

'Detects multiple failed queries in short timeframe.'

MITRE ATT&CK coverage

Rule body

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

These rows show field, operator, and value matches.

Output fields

These fields are emitted when the rule matches.

FieldSource
TargetUsernamesummarize
AccountCustomEntityextend