Detection rules › Kusto
Snowflake - Query on sensitive or restricted table
'Detects query on sensitive or restricted table.'
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Collection |
Rule body
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
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
QueryExecutionStatus | eq |
| field:"QueryExecutionStatus" kind:eq value:"SUCCESS" |
QueryType | eq |
| field:"QueryType" kind:eq value:"SELECT" |
tbl | in |
| field:"tbl" kind:in value:"r_tbl" |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
tbl | extend |
AccountCustomEntity | extend |