Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Snowflake - User granted admin privileges

Back
Id5ed33eee-0ab6-4bf5-9e9b-6100db83d39a
RulenameSnowflake - User granted admin privileges
DescriptionDetects when user asigned admin privileges.
SeverityMedium
TacticsPrivilegeEscalation
TechniquesT1078
Required data connectorsSnowflake
KindScheduled
Query frequency1h
Query period1h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakeUserAddAdminPrivileges.yaml
Version1.0.0
Arm template5ed33eee-0ab6-4bf5-9e9b-6100db83d39a.json
Deploy To Azure
let adm_roles = dynamic(['SECURITYADMIN', 'SYSADMIN', 'ACCOUNTADMIN']);
Snowflake
| where QUERY_TYPE_s =~ 'GRANT'
| where QUERY_TEXT_s startswith 'GRANT ROLE'
| extend granted_role = extract(@'GRANT ROLE\s(\S+)\sto\suser', 1, QUERY_TEXT_s)
| where granted_role in~ (adm_roles)
| extend usr = extract(@'GRANT ROLE\s(\S+)\sto\suser(\S+)', 2, QUERY_TEXT_s)
| extend AccountCustomEntity = usr
kind: Scheduled
relevantTechniques:
- T1078
description: |
    'Detects when user asigned admin privileges.'
queryPeriod: 1h
queryFrequency: 1h
tactics:
- PrivilegeEscalation
name: Snowflake - User granted admin privileges
requiredDataConnectors:
- connectorId: Snowflake
  dataTypes:
  - Snowflake
entityMappings:
- entityType: Account
  fieldMappings:
  - identifier: Name
    columnName: AccountCustomEntity
triggerThreshold: 0
version: 1.0.0
id: 5ed33eee-0ab6-4bf5-9e9b-6100db83d39a
query: |
  let adm_roles = dynamic(['SECURITYADMIN', 'SYSADMIN', 'ACCOUNTADMIN']);
  Snowflake
  | where QUERY_TYPE_s =~ 'GRANT'
  | where QUERY_TEXT_s startswith 'GRANT ROLE'
  | extend granted_role = extract(@'GRANT ROLE\s(\S+)\sto\suser', 1, QUERY_TEXT_s)
  | where granted_role in~ (adm_roles)
  | extend usr = extract(@'GRANT ROLE\s(\S+)\sto\suser(\S+)', 2, QUERY_TEXT_s)
  | extend AccountCustomEntity = usr  
status: Available
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakeUserAddAdminPrivileges.yaml
severity: Medium
{
  "$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/5ed33eee-0ab6-4bf5-9e9b-6100db83d39a')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/5ed33eee-0ab6-4bf5-9e9b-6100db83d39a')]",
      "properties": {
        "alertRuleTemplateName": "5ed33eee-0ab6-4bf5-9e9b-6100db83d39a",
        "customDetails": null,
        "description": "'Detects when user asigned admin privileges.'\n",
        "displayName": "Snowflake - User granted admin privileges",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountCustomEntity",
                "identifier": "Name"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Analytic Rules/SnowflakeUserAddAdminPrivileges.yaml",
        "query": "let adm_roles = dynamic(['SECURITYADMIN', 'SYSADMIN', 'ACCOUNTADMIN']);\nSnowflake\n| where QUERY_TYPE_s =~ 'GRANT'\n| where QUERY_TEXT_s startswith 'GRANT ROLE'\n| extend granted_role = extract(@'GRANT ROLE\\s(\\S+)\\sto\\suser', 1, QUERY_TEXT_s)\n| where granted_role in~ (adm_roles)\n| extend usr = extract(@'GRANT ROLE\\s(\\S+)\\sto\\suser(\\S+)', 2, QUERY_TEXT_s)\n| extend AccountCustomEntity = usr\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "PrivilegeEscalation"
        ],
        "techniques": [
          "T1078"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}