azure-appsvc-container-write

derived azure emits CanModifyCode

match (effective permission)

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

where

site is a custom-container / Linux container app (properties.siteConfig.linuxFxVersion references a container image)

emit

source typeIdentity
source<principal>
target<Microsoft.Web/sites>
permissionsMicrosoft.Web/sites/sitecontainers/write
conditionsservice_state

Narrative

{principal.name} can set the container image of {target.name} (sitecontainers/write) to an attacker image.

Raw rule rules/derived/azure/appservice.yaml

id: azure-appsvc-container-write
emits: CanModifyCode
match_effective_permission:
  action: Microsoft.Web/sites/sitecontainers/write
  scope_type: resource|resourceGroup|subscription
where:
- site is a custom-container / Linux container app (properties.siteConfig.linuxFxVersion references a
  container image)
emit:
  source_type: Identity
  source: <principal>
  target: <Microsoft.Web/sites>
  permissions:
  - Microsoft.Web/sites/sitecontainers/write
  conditions:
  - service_state
  escalation: Set/replace the container image the app runs to an attacker image.
  false_positive_note: Only meaningful for custom-container apps; code apps ignore container settings.
    Requires restart/pull to take effect.
  narrative: '{principal.name} can set the container image of {target.name} (sitecontainers/write) to
    an attacker image.'
move · open · esc close