Detection rules › Panther

Snowflake Grant to Public Role

Severity
medium
Log types
Snowflake.GrantsToRoles
Tags
Snowflake, [MITRE] Privilege Escalation, [MITRE] Valid Accounts, [MITRE] Valid Accounts: Default Accounts
Source
github.com/panther-labs/panther-analysis

Detect additional grants to the public role.

MITRE ATT&CK coverage

TacticTechniques
Privilege EscalationT1078.001 Valid Accounts: Default Accounts

Rule body yaml

AnalysisType: rule
Filename: snowflake_stream_public_role_grant.py
RuleID: Snowflake.Stream.PublicRoleGrant
DisplayName: Snowflake Grant to Public Role
Enabled: true
LogTypes:
  - Snowflake.GrantsToRoles
Severity: Medium
Reports:
  MITRE ATT&CK:
    - TA0004:T1078.001
Description: Detect additional grants to the public role.
Runbook: Determine if this is a necessary grant for the public role, which should
  be kept to the fewest possible.
Tags:
  - Snowflake
  - '[MITRE] Privilege Escalation'
  - '[MITRE] Valid Accounts'
  - '[MITRE] Valid Accounts: Default Accounts'
Tests:
  - Name: SELECT Granted to Public
    ExpectedResult: true
    Log:
      {
        "p_source_label": "DailyPlanet-Snowflake",
        "CREATED_ON": "2024-10-10 12:56:35.822 -0700",
        "MODIFIED_ON": "2024-10-10 12:56:35.822 -0700",
        "PRIVILEGE": "SELECT",
        "GRANTED_ON": "TABLE",
        "NAME": "MYTABLE",
        "TABLE_CATALOG": "TEST_DB",
        "TABLE_SCHEMA": "PUBLIC",
        "GRANTED_TO": "ROLE",
        "GRANTEE_NAME": "PUBLIC",
        "GRANT_OPTION": false,
        "GRANTED_BY": "ACCOUNTADMIN",
        "DELETED_ON": "",
        "GRANTED_BY_ROLE_TYPE": "ROLE",
        "OBJECT_INSTANCE": ""
      }
  - Name: Privilege Granted to Non-PUBLIC Role
    ExpectedResult: false
    Log:
      {
        "p_source_label": "DailyPlanet-Snowflake",
        "CREATED_ON": "2024-10-10 12:56:35.822 -0700",
        "MODIFIED_ON": "2024-10-10 12:56:35.822 -0700",
        "PRIVILEGE": "SELECT",
        "GRANTED_ON": "TABLE",
        "NAME": "MYTABLE",
        "TABLE_CATALOG": "TEST_DB",
        "TABLE_SCHEMA": "PUBLIC",
        "GRANTED_TO": "ROLE",
        "GRANTEE_NAME": "APP_READONLY",
        "GRANT_OPTION": false,
        "GRANTED_BY": "ACCOUNTADMIN",
        "DELETED_ON": "",
        "GRANTED_BY_ROLE_TYPE": "ROLE",
        "OBJECT_INSTANCE": ""
      }

Detection logic

Condition

GRANTEE_NAME eq "public"

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
GRANTEE_NAMEeq
  • public

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

Field
p_source_label
GRANTED_BY