azure-func-master-key

derived azure emits CanReadSecret

match (effective permission)

{ "action": "Microsoft.Web/sites/functions/masterkey/read", "scope_type": "resource|resourceGroup|subscription" }

emit

source<principal>
target<master key of the function app>
permissionsMicrosoft.Web/sites/functions/masterkey/read

Narrative

{principal.name} can read the master key of {target.name} (functions/masterkey/read), unlocking the admin runtime API.

Raw rule rules/derived/azure/functions.yaml

id: azure-func-master-key
emits: CanReadSecret
match_effective_permission:
  action: Microsoft.Web/sites/functions/masterkey/read
  scope_type: resource|resourceGroup|subscription
emit:
  source: <principal>
  target: <master key of the function app>
  permissions:
  - Microsoft.Web/sites/functions/masterkey/read
  note: The master key grants the admin runtime REST API (hostruntime/host) to overwrite and invoke any
    function -> de-facto code execution as the MI.
  false_positive_note: Master key is a durable data-plane secret surviving RBAC removal; treat as a backdoor.
    Master key without a running app -> CONDITIONAL(service_state).
  narrative: '{principal.name} can read the master key of {target.name} (functions/masterkey/read), unlocking
    the admin runtime API.'
move · open · esc close