azure-sf-app-attach-user-mi
match
A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.
where
?principal has EFFECTIVE Microsoft.ServiceFabric/managedclusters/applications/write on the target application (existing or new)
emit
| source type | Identity |
|---|---|
| target type | Compute |
| source | <principal> |
| target | <serviceFabric application (existing or new)> |
| permissions | Microsoft.ManagedIdentity/userAssignedIdentities/assign/action Microsoft.ServiceFabric/managedclusters/applications/write |
| conditions | role_compatibility |
Narrative
{principal.name} can attach user-assigned MI {userMI.name} to SF application {target.name} (assign/action + applications/write).
Raw rule rules/derived/azure/servicefabric.yaml
id: azure-sf-app-attach-user-mi
emits: CanAttachIdentity
match:
- - principal: null
- CanPassIdentity
- userMI: null
where:
- ?principal has EFFECTIVE Microsoft.ServiceFabric/managedclusters/applications/write on the target application
(existing or new)
emit:
source_type: Identity
target_type: Compute
source: <principal>
target: <serviceFabric application (existing or new)>
permissions:
- Microsoft.ManagedIdentity/userAssignedIdentities/assign/action
- Microsoft.ServiceFabric/managedclusters/applications/write
conditions:
- role_compatibility
false_positive_note: 'BOTH permissions are required: the CanPassIdentity edge (produced by azure-sf-app-pass-user-mi
from assign/action on the MI) AND applications/write on the app. Neither alone attaches the MI. Honor
the assign/action resource scope. This attaches to the APPLICATION MI plane, not the node/VMSS MI.'
narrative: '{principal.name} can attach user-assigned MI {userMI.name} to SF application {target.name}
(assign/action + applications/write).'