azure-appsvc-function-write

derived azure emits CanModifyCode

match (effective permission)

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

where

site is a Function App (kind contains 'functionapp')

emit

source typeIdentity
source<principal>
target<Microsoft.Web/sites (Function App)>
permissionsMicrosoft.Web/sites/functions/write
conditionsservice_state

Narrative

{principal.name} can write function code to {target.name} (functions/write), executing as the app's identity.

Raw rule rules/derived/azure/appservice.yaml

id: azure-appsvc-function-write
emits: CanModifyCode
match_effective_permission:
  action: Microsoft.Web/sites/functions/write
  scope_type: resource|resourceGroup|subscription
where:
- site is a Function App (kind contains 'functionapp')
emit:
  source_type: Identity
  source: <principal>
  target: <Microsoft.Web/sites (Function App)>
  permissions:
  - Microsoft.Web/sites/functions/write
  conditions:
  - service_state
  escalation: Write/replace a function's code; it runs as the app MI on next trigger/invoke.
  false_positive_note: Function Apps only. Runtime deployment model (RunFromPackage read-only) can block
    direct function writes; then use publish/action instead.
  narrative: '{principal.name} can write function code to {target.name} (functions/write), executing as
    the app''s identity.'
move · open · esc close