Detection rules › Kusto

Snowflake - Query on sensitive or restricted table

Status
available
Severity
medium
Time window
1h
Source
github.com/Azure/Azure-Sentinel

'Detects query on sensitive or restricted table.'

MITRE ATT&CK coverage

TacticTechniques
CollectionT1119 Automated Collection

Rule body kusto

id: f258fa0c-e26c-4e2b-94fb-88b6cef0ca6e
name: Snowflake - Query on sensitive or restricted table
description: |
  'Detects query on sensitive or restricted table.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: Snowflake
    dataTypes:
      - Snowflake
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Collection
relevantTechniques:
  - T1119
query: |
  let r_tbl = dynamic(['table_name']);
  Snowflake
  | where QueryType =~ 'SELECT'
  | where QueryExecutionStatus =~ 'SUCCESS'
  | extend tbl = extract(@'(FROM|from)\s(\S+)\s', 2, QueryText)
  | where tbl in~ (r_tbl)
  | extend AccountCustomEntity = TargetUsername
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: AccountCustomEntity
version: 1.0.1
kind: Scheduled

Stages and Predicates

Parameters

let r_tbl = dynamic(['table_name']);

Stage 1: source

Snowflake

Stage 2: where

| where QueryType =~ 'SELECT'

Stage 3: where

| where QueryExecutionStatus =~ 'SUCCESS'

Stage 4: extend

| extend tbl = extract(@'(FROM|from)\s(\S+)\s', 2, QueryText)

Stage 5: where

| where tbl in~ (r_tbl)

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.

FieldKindValues
QueryExecutionStatuseq
  • SUCCESS
QueryTypeeq
  • SELECT
tblin
  • r_tbl

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.

FieldSource
tblextend
AccountCustomEntityextend