let adm_roles = dynamic(['SECURITYADMIN', 'SYSADMIN', 'ACCOUNTADMIN']);
Snowflake
| where QueryType =~ 'GRANT'
| where QueryText startswith 'GRANT ROLE'
| extend granted_role = extract(@'GRANT ROLE\s(\S+)\sto\suser', 1, QueryText)
| where granted_role in~ (adm_roles)
| extend usr = extract(@'GRANT ROLE\s(\S+)\sto\suser(\S+)', 2, QueryText)
| extend AccountCustomEntity = usr
name: Snowflake - User granted admin privileges
id: 5ed33eee-0ab6-4bf5-9e9b-6100db83d39a
description: |
'Detects when user asigned admin privileges.'
triggerThreshold: 0
entityMappings:
- fieldMappings:
- columnName: AccountCustomEntity
identifier: Name
entityType: Account
version: 1.0.1
triggerOperator: gt
query: |
let adm_roles = dynamic(['SECURITYADMIN', 'SYSADMIN', 'ACCOUNTADMIN']);
Snowflake
| where QueryType =~ 'GRANT'
| where QueryText startswith 'GRANT ROLE'
| extend granted_role = extract(@'GRANT ROLE\s(\S+)\sto\suser', 1, QueryText)
| where granted_role in~ (adm_roles)
| extend usr = extract(@'GRANT ROLE\s(\S+)\sto\suser(\S+)', 2, QueryText)
| extend AccountCustomEntity = usr
tactics:
- PrivilegeEscalation
kind: Scheduled
queryFrequency: 1h
severity: Medium
queryPeriod: 1h
requiredDataConnectors:
- dataTypes:
- Snowflake
connectorId: Snowflake
status: Available
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakeUserAddAdminPrivileges.yaml
relevantTechniques:
- T1078