Snowflake
| where QUERY_TYPE_s =~ 'SHOW'
| where QUERY_TEXT_s has_all ('SHOW', 'ROLES')
| extend AccountCustomEntity = TargetUsername
relevantTechniques:
- T1087
name: Snowflake - Possible privileges discovery activity
requiredDataConnectors:
- dataTypes:
- Snowflake
connectorId: Snowflake
entityMappings:
- fieldMappings:
- identifier: Name
columnName: AccountCustomEntity
entityType: Account
triggerThreshold: 0
id: 627a4ff1-036b-4375-a9f9-288d5e1d7d37
tactics:
- Discovery
version: 1.0.0
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakePrivilegesDiscovery.yaml
queryPeriod: 1h
kind: Scheduled
queryFrequency: 1h
severity: Medium
status: Available
description: |
'Detects possible privileges discovery activity.'
query: |
Snowflake
| where QUERY_TYPE_s =~ 'SHOW'
| where QUERY_TEXT_s has_all ('SHOW', 'ROLES')
| extend AccountCustomEntity = TargetUsername
triggerOperator: gt
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"apiVersion": "2024-01-01-preview",
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/627a4ff1-036b-4375-a9f9-288d5e1d7d37')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/627a4ff1-036b-4375-a9f9-288d5e1d7d37')]",
"properties": {
"alertRuleTemplateName": "627a4ff1-036b-4375-a9f9-288d5e1d7d37",
"customDetails": null,
"description": "'Detects possible privileges discovery activity.'\n",
"displayName": "Snowflake - Possible privileges discovery activity",
"enabled": true,
"entityMappings": [
{
"entityType": "Account",
"fieldMappings": [
{
"columnName": "AccountCustomEntity",
"identifier": "Name"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakePrivilegesDiscovery.yaml",
"query": "Snowflake\n| where QUERY_TYPE_s =~ 'SHOW'\n| where QUERY_TEXT_s has_all ('SHOW', 'ROLES')\n| extend AccountCustomEntity = TargetUsername\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"severity": "Medium",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Discovery"
],
"techniques": [
"T1087"
],
"templateVersion": "1.0.0",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}