azure-dbx-sql-warehouse-query-execute

Admin role on a SQL Warehouse allows running arbitrary SQL queries that execute as the warehouse MI.

derived azure emits CanModifyCode

match (effective permission)

{ "action": "databricks:sql:warehouse:execute", "scope_type": "warehouse" }

where

principal has Databricks Workspace Admin role or CAN_MANAGE on a SQL Warehouse (POST /api/2.0/sql/statements)

emit

source typeIdentity
source<principal>
target<Databricks SQL Warehouse (DataWarehouse)>
permissionsdatabricks:sql:warehouse:execute (Admin role or CAN_MANAGE on warehouse)
conditionsservice_state

Narrative

{principal.name} can execute SQL queries on Databricks SQL Warehouse {target.name} (Admin or CAN_MANAGE), running arbitrary queries as the warehouse MI that can access Azure resources via IMDS.

Raw rule rules/derived/azure/databricks.yaml

id: azure-dbx-sql-warehouse-query-execute
emits: CanModifyCode
description: Admin role on a SQL Warehouse allows running arbitrary SQL queries that execute as the warehouse
  MI.
match_effective_permission:
  action: databricks:sql:warehouse:execute
  scope_type: warehouse
where:
- principal has Databricks Workspace Admin role or CAN_MANAGE on a SQL Warehouse (POST /api/2.0/sql/statements)
emit:
  source_type: Identity
  source: <principal>
  target: <Databricks SQL Warehouse (DataWarehouse)>
  permissions:
  - databricks:sql:warehouse:execute (Admin role or CAN_MANAGE on warehouse)
  conditions:
  - service_state
  escalation: Submit a SQL query to the warehouse that executes as the warehouse MI (via the workspace
    Access Connector MI). Queries can invoke external datasets (ADLS Gen2, Azure SQL, Synapse, etc.) using
    the MI's ARM RBAC credentials via IMDS.
  false_positive_note: SQL Warehouse code execution is less direct than cluster notebook modification.
    Requires that the warehouse is running; CONDITIONAL(service_state) if stopped. The query must use
    SQL-level features (external locations, Azure SQL auth) to escalate. Direct SQL command execution
    is still attacker-controllable code.
  narrative: '{principal.name} can execute SQL queries on Databricks SQL Warehouse {target.name} (Admin
    or CAN_MANAGE), running arbitrary queries as the warehouse MI that can access Azure resources via
    IMDS.'
move · open · esc close