azure-appsvc-extension-write
match (effective permission)
{
"action": [
"Microsoft.Web/sites/extensions/write",
"Microsoft.Web/sites/siteextensions/write"
],
"scope_type": "resource|resourceGroup|subscription"
}
emit
| source type | Identity |
|---|---|
| source | <principal> |
| target | <Microsoft.Web/sites> |
| permissions | Microsoft.Web/sites/extensions/write Microsoft.Web/sites/siteextensions/write |
| conditions | service_state |
Narrative
{principal.name} can install a site extension on {target.name} (extensions/write), running attacker code in the worker.
Raw rule rules/derived/azure/appservice.yaml
id: azure-appsvc-extension-write
emits: CanModifyCode
match_effective_permission:
action:
- Microsoft.Web/sites/extensions/write
- Microsoft.Web/sites/siteextensions/write
scope_type: resource|resourceGroup|subscription
emit:
source_type: Identity
source: <principal>
target: <Microsoft.Web/sites>
permissions:
- Microsoft.Web/sites/extensions/write
- Microsoft.Web/sites/siteextensions/write
conditions:
- service_state
escalation: Install a site/Kudu extension that runs in the app worker process.
false_positive_note: Extension loads in the worker; if the app is stopped, CONDITIONAL(service_state)
+ CanStart.
narrative: '{principal.name} can install a site extension on {target.name} (extensions/write), running
attacker code in the worker.'