For the complete documentation index, see llms.txt. This page is also available as Markdown.

AZ_MANAGED_IDENTITY_ASSIGNABLE_BY

Summary

Property
Value

Forestall ACL Alias

AZ_MANAGED_IDENTITY_ASSIGNABLE_BY

Description

This UAMI can be attached to a compute resource by this principal for token theft (via IMDS)

Source Node

AZUserAssignedIdentity

Target Node

AZUser / AZGroup / AZServicePrincipal

Severity

High

Category

ARM Roles

Built-in Roles

Role
GUID

Owner

8e3af657-a8ff-443c-a75c-2fe8c4bcb635

Contributor

b24988ac-6180-42a0-ab88-20f7382dd24c

Managed Identity Contributor

e40ec5ca-96e0-45a2-b4ff-59039f2c2b59

Managed Identity Operator

f1a07417-d97a-45cb-824c-7a7467783830

Azure Red Hat OpenShift Machine API Operator

0358943c-7e01-48ba-8889-02cc51d78637

Custom Role Actions

  • Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/action

  • Microsoft.ManagedIdentity/userAssignedIdentities/assign/action

Wildcard actions (*) at the Microsoft.ManagedIdentity scope also grant this primitive.

Description

AZ_MANAGED_IDENTITY_ASSIGNABLE_BY represents the ability to attach a User-Assigned Managed Identity (UAMI) to an Azure compute resource. Once attached, code running on that resource can request an OAuth token for the UAMI from IMDS (169.254.169.254) and inherit all role assignments held by that UAMI.

This edge alone is not RCE. The attacker also needs:

  1. write on a compute/workflow resource that can carry an identity

  2. A way to run code on that resource (e.g., RunCommand, Kudu, runbook)

Chain with: AZ_EXECUTE_COMMAND, AZ_LOGIC_APP_CONTRIBUTOR, AZ_AUTOMATION_CONTRIBUTOR, AZ_WEBSITE_CONTRIBUTOR.

Exploitation

Prerequisites: assign/action on a UAMI + write + execution primitive on a compute resource.

PoC: Attach UAMI to VM, Steal Token via RunCommand

Step 1 — Attach the UAMI

Attach the UAMI to a vm

Step 2 — Steal the token

Linux VM:

Windows VM:

Steal the token

Other Attack Vectors

Vector
Attach
Execute
Reference

New VM

az vm create --assign-identity

RunCommand

Logic App

az logic workflow identity assign --user-assigned

HTTP action with MSI auth

Automation Account

REST PATCH identity block

Runbook

Web App / Function App

az webapp identity assign --identities

Kudu / Web SSH

ACR Task

az acr task create --assign-identity

Task step

ML Workspace

REST PATCH identity block

Notebook / job

Identification

Azure CLI

Azure Portal

  1. Managed Identities → select UAMI → Access control (IAM) → Role assignments

  2. Look for Owner, Contributor, Managed Identity Operator, or Managed Identity Contributor

Mitigation

  1. Least-privilege on UAMI scope — Audit principals with assign action on each UAMI

  2. Reduce UAMI blast radius — Break apart UAMIs with Owner/Contributor into workload-specific UAMIs

  3. Use PIM — Make Managed Identity Operator eligible (JIT) rather than active

  4. Azure Policy — Deny */assign/action outside approved scopes

Detection

Alert on:

  • assign/action against a UAMI by an unusual principal

  • identity.userAssignedIdentities changes on compute resources

  • Managed identity sign-in immediately after a new attachment

References

Last updated

Was this helpful?