azure-vm-imds-exposescred

A VM bound to a managed identity leaks that identity's credential via the IMDS token endpoint (the exposure fact paired with azure-vm-imds-token).

derived azure emits ExposesCredential

match

A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.

{'vm': None} ExecutesAs {'mi': None}

emit

source<virtualMachine>
target<managed identity bound to the VM>

Narrative

{vm.name} exposes the credential of managed identity {mi.name} via IMDS (169.254.169.254) to any code running on it.

Raw rule rules/derived/azure/vm.yaml

id: azure-vm-imds-exposescred
emits: ExposesCredential
description: A VM bound to a managed identity leaks that identity's credential via the IMDS token endpoint
  (the exposure fact paired with azure-vm-imds-token).
match:
- - vm: null
  - ExecutesAs
  - mi: null
emit:
  source: <virtualMachine>
  target: <managed identity bound to the VM>
  permissions: []
  note: IMDS on the VM exposes a mintable bearer token for each bound MI; complements azure-vm-imds-token
    (CanRetrieveToken) with the credential-leak fact consumers key on.
  false_positive_note: Only fires when the VM actually has a managed identity (identity.type != None).
    No MI => no exposure; do NOT emit.
  narrative: '{vm.name} exposes the credential of managed identity {mi.name} via IMDS (169.254.169.254)
    to any code running on it.'
move · open · esc close