azure-func-sourcecontrols-write
match (effective permission)
{
"action": "Microsoft.Web/sites/sourcecontrols/Write",
"scope_type": "resource|resourceGroup|subscription"
}
emit
| source type | Identity |
|---|---|
| source | <principal> |
| target | <function app> |
| permissions | Microsoft.Web/sites/sourcecontrols/Write |
| conditions | service_state |
Narrative
{principal.name} can hijack the source control of {target.name} (sourcecontrols/Write), injecting code at next deploy.
Raw rule rules/derived/azure/functions.yaml
id: azure-func-sourcecontrols-write
emits: CanModifyCode
match_effective_permission:
action: Microsoft.Web/sites/sourcecontrols/Write
scope_type: resource|resourceGroup|subscription
emit:
source_type: Identity
source: <principal>
target: <function app>
permissions:
- Microsoft.Web/sites/sourcecontrols/Write
conditions:
- service_state
escalation: Repoint CI/CD source control to an attacker repo; code is injected at the next sync/deploy
(supply-chain).
false_positive_note: Only yields execution if continuous deployment / sync actually pulls the attacker
source; if source control is not configured to auto-sync -> CONDITIONAL.
narrative: '{principal.name} can hijack the source control of {target.name} (sourcecontrols/Write),
injecting code at next deploy.'