azure-containerapps-write-image

derived azure emits CanModifyCode

match (effective permission)

{ "action": "Microsoft.App/containerApps/write", "scope_type": "resource|resourceGroup|subscription" }

emit

source typeIdentity
source<principal>
target<containerApp>
permissionsMicrosoft.App/containerApps/write

Narrative

{principal.name} can replace the container image/command of {target.name} (containerApps/write), running attacker code as its managed identity.

Raw rule rules/derived/azure/containerapps.yaml

id: azure-containerapps-write-image
emits: CanModifyCode
match_effective_permission:
  action: Microsoft.App/containerApps/write
  scope_type: resource|resourceGroup|subscription
emit:
  source_type: Identity
  source: <principal>
  target: <containerApp>
  permissions:
  - Microsoft.App/containerApps/write
  escalation: Set template.containers[].image / command / args / env to an attacker-controlled image;
    the new revision runs as the app's managed identity.
  false_positive_note: Needs NO container credential and NO exec data action; the control-plane write
    alone creates a revision running attacker code as the MI. Only escalates if the app has an MI that
    out-privileges the caller.
  narrative: '{principal.name} can replace the container image/command of {target.name} (containerApps/write),
    running attacker code as its managed identity.'
move · open · esc close