Snowflake
| where QUERY_TYPE_s =~ 'SELECT'
| where EXECUTION_STATUS_s =~ 'SUCCESS'
| where QUERY_TEXT_s startswith @'SELECT *'
| extend AccountCustomEntity = TargetUsername
version: 1.0.0
status: Available
queryFrequency: 1h
requiredDataConnectors:
- connectorId: Snowflake
dataTypes:
- Snowflake
entityMappings:
- fieldMappings:
- columnName: AccountCustomEntity
identifier: Name
entityType: Account
kind: Scheduled
queryPeriod: 1h
severity: Medium
query: |
Snowflake
| where QUERY_TYPE_s =~ 'SELECT'
| where EXECUTION_STATUS_s =~ 'SUCCESS'
| where QUERY_TEXT_s startswith @'SELECT *'
| extend AccountCustomEntity = TargetUsername
triggerOperator: gt
id: 1dd1d9e5-3ebf-43cb-be07-6082d5eabe79
description: |
'Detects unusual query.'
triggerThreshold: 0
name: Snowflake - Unusual query
relevantTechniques:
- T1119
tactics:
- Collection
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakeUnusualQuery.yaml
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/1dd1d9e5-3ebf-43cb-be07-6082d5eabe79')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/1dd1d9e5-3ebf-43cb-be07-6082d5eabe79')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "Snowflake - Unusual query",
"description": "'Detects unusual query.'\n",
"severity": "Medium",
"enabled": true,
"query": "Snowflake\n| where QUERY_TYPE_s =~ 'SELECT'\n| where EXECUTION_STATUS_s =~ 'SUCCESS'\n| where QUERY_TEXT_s startswith @'SELECT *'\n| extend AccountCustomEntity = TargetUsername\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Collection"
],
"techniques": [
"T1119"
],
"alertRuleTemplateName": "1dd1d9e5-3ebf-43cb-be07-6082d5eabe79",
"customDetails": null,
"entityMappings": [
{
"entityType": "Account",
"fieldMappings": [
{
"identifier": "Name",
"columnName": "AccountCustomEntity"
}
]
}
],
"status": "Available",
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakeUnusualQuery.yaml",
"templateVersion": "1.0.0"
}
}
]
}