azure-dbx-notebook-write

CAN_MANAGE on a notebook path allows overwriting notebook code via import/overwrite; runs as the cluster MI on next execution.

derived azure emits CanModifyCode

match (effective permission)

{ "action": "databricks:notebooks:modify", "scope_type": "notebook_path|workspace_path" }

where

principal has Databricks CAN_MANAGE permission on the target notebook path (enables POST /api/2.0/workspace/import with overwrite=true) the notebook is attached to a cluster (all-purpose cluster) or referenced by a job

emit

source typeIdentity
target typeNotebook
source<principal>
target<Databricks Notebook>
permissionsdatabricks:notebooks:modify (CAN_MANAGE on the notebook path — POST /api/2.0/workspace/import with overwrite=true)
conditionsservice_state trigger_exists

Narrative

{principal.name} can overwrite notebook {target.name} code (Databricks CAN_MANAGE on the path, /api/2.0/workspace/import with overwrite=true); on next run on the cluster, attacker code executes as the cluster's managed identity.

Raw rule rules/derived/azure/databricks.yaml

id: azure-dbx-notebook-write
emits: CanModifyCode
description: CAN_MANAGE on a notebook path allows overwriting notebook code via import/overwrite; runs
  as the cluster MI on next execution.
match_effective_permission:
  action: databricks:notebooks:modify
  scope_type: notebook_path|workspace_path
where:
- principal has Databricks CAN_MANAGE permission on the target notebook path (enables POST /api/2.0/workspace/import
  with overwrite=true)
- the notebook is attached to a cluster (all-purpose cluster) or referenced by a job
emit:
  target_type: Notebook
  source_type: Identity
  source: <principal>
  target: <Databricks Notebook>
  permissions:
  - "databricks:notebooks:modify (CAN_MANAGE on the notebook path \u2014 POST /api/2.0/workspace/import\
    \ with overwrite=true)"
  conditions:
  - service_state
  - trigger_exists
  escalation: Overwrite the notebook code with attacker-controlled content (POST /api/2.0/workspace/import
    with overwrite=true); on the next cluster run (interactive session, scheduled job, or run-now trigger),
    attacker code executes as the cluster/Access Connector managed identity. Cite can-execute-as.
  false_positive_note: CAN_MANAGE (not CAN_EDIT or WRITE alone) is required to overwrite notebooks via
    the import API. CAN_EDIT allows editing but not import/overwrite for notebooks owned by others. If
    no cluster is running and no job trigger exists -> CONDITIONAL(trigger_exists). CAN_RUN on a job is
    NOT notebook write; the trigger-only path (cicd-chains cicd-trigger-runner-executes-as) applies. Code
    runs as whatever MI is on the cluster the notebook attaches to.
  narrative: '{principal.name} can overwrite notebook {target.name} code (Databricks CAN_MANAGE on the
    path, /api/2.0/workspace/import with overwrite=true); on next run on the cluster, attacker code executes
    as the cluster''s managed identity.'
move · open · esc close