azure-appsvc-sourcecontrol-write
match (effective permission)
{
"action": "Microsoft.Web/sites/sourcecontrols/write",
"scope_type": "resource|resourceGroup|subscription"
}
emit
| source type | Identity |
|---|---|
| source | <principal> |
| target | <Microsoft.Web/sites> |
| permissions | Microsoft.Web/sites/sourcecontrols/write |
| conditions | service_state |
Narrative
{principal.name} can repoint the source control of {target.name} to an attacker repo (sourcecontrols/write).
Raw rule rules/derived/azure/appservice.yaml
id: azure-appsvc-sourcecontrol-write
emits: CanModifyCode
match_effective_permission:
action: Microsoft.Web/sites/sourcecontrols/write
scope_type: resource|resourceGroup|subscription
emit:
source_type: Identity
source: <principal>
target: <Microsoft.Web/sites>
permissions:
- Microsoft.Web/sites/sourcecontrols/write
conditions:
- service_state
escalation: Point the app's deployment source at an attacker-controlled Git repo; the build/deploy pipeline
runs attacker code.
false_positive_note: Realizes execution on the next sync/build; requires continuous deployment to actually
pull. On a stopped app CONDITIONAL(service_state).
narrative: '{principal.name} can repoint the source control of {target.name} to an attacker repo (sourcecontrols/write).'