azure-func-config-write

derived azure emits CanModifyConfiguration

match (effective permission)

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

emit

source typeIdentity
target type*
source<principal>
target<function app>
permissionsMicrosoft.Web/sites/config/Write
conditionsservice_state

Narrative

{principal.name} can rewrite app settings/config of {target.name} (config/Write), swapping the running package or injecting code.

Raw rule rules/derived/azure/functions.yaml

id: azure-func-config-write
emits: CanModifyConfiguration
match_effective_permission:
  action: Microsoft.Web/sites/config/Write
  scope_type: resource|resourceGroup|subscription
emit:
  source_type: Identity
  target_type: '*'
  source: <principal>
  target: <function app>
  permissions:
  - Microsoft.Web/sites/config/Write
  conditions:
  - service_state
  escalation: Set WEBSITE_RUN_FROM_PACKAGE to an attacker package, change linuxFxVersion/container image
    or startup command, or inject secrets/env.
  false_positive_note: Realizes execution at next restart/deploy; pair with a trigger/CanInvoke or CanStart
    for ACTIVE. config/Write alone is config change, not immediate exec.
  narrative: '{principal.name} can rewrite app settings/config of {target.name} (config/Write), swapping
    the running package or injecting code.'
move · open · esc close