azure-vm-run-command
match (effective permission)
{
"action": "Microsoft.Compute/virtualMachines/runCommand/action",
"scope_type": "resource|resourceGroup|subscription"
}
emit
| source type | Identity |
|---|---|
| source | <principal> |
| target | <virtualMachine> |
| permissions | Microsoft.Compute/virtualMachines/runCommand/action |
| conditions | service_state |
| state logic | ACTIVE if VM power state is running; else CONDITIONAL(service_state) and pair with azure-vm-start |
Narrative
{principal.name} can run arbitrary scripts as SYSTEM/root on {target.name} (Microsoft.Compute/virtualMachines/runCommand/action).
Raw rule rules/derived/azure/vm.yaml
id: azure-vm-run-command
emits: CanExecuteCommand
match_effective_permission:
action: Microsoft.Compute/virtualMachines/runCommand/action
scope_type: resource|resourceGroup|subscription
emit:
source_type: Identity
source: <principal>
target: <virtualMachine>
permissions:
- Microsoft.Compute/virtualMachines/runCommand/action
conditions:
- service_state
state_logic: ACTIVE if VM power state is running; else CONDITIONAL(service_state) and pair with azure-vm-start
false_positive_note: runCommand only executes on a running VM; on a stopped/deallocated VM emit CONDITIONAL(service_state).
No OS credential is required.
narrative: '{principal.name} can run arbitrary scripts as SYSTEM/root on {target.name} (Microsoft.Compute/virtualMachines/runCommand/action).'