المهارات azure-rbac
📦

azure-rbac

آمن

以最低權限指派 Azure RBAC 角色

此技能可協助 Azure 管理員找出特定權限所需的最小 RBAC 角色,並產生安全的 CLI 命令和 Bicep 程式碼來進行指派。

يدعم: Claude Codex Code(CC)
🥉 74 برونزي
1

تنزيل ZIP المهارة

2

رفع في Claude

اذهب إلى Settings → Capabilities → Skills → Upload skill

3

فعّل وابدأ الاستخدام

اختبرها

استخدام "azure-rbac". What role should I assign for a managed identity to read blobs?

النتيجة المتوقعة:

  • Storage Blob Data Reader (preview) is the recommended built-in role for read-only access to blob storage.
  • Resource scope: The role can be assigned at storage account, container, or blob level.
  • For least privilege, assign at the specific container level rather than the entire storage account.

استخدام "azure-rbac". Generate Bicep code to assign a role to a service principal

النتيجة المتوقعة:

  • resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { name: guid(subscription().id, servicePrincipalId, roleDefinitionId) properties: { principalId: servicePrincipalId roleDefinitionId: roleDefinitionId principalType: 'ServicePrincipal' } }

التدقيق الأمني

آمن
v1 • 2/21/2026

Static analysis flagged 4 instances of 'Weak cryptographic algorithm' at SKILL.md lines 3 and 8. These are FALSE POSITIVES. Line 3 contains YAML syntax (description: >-) for multiline strings. Line 8 references Azure MCP tools (azure__documentation, azure__extension_cli_generate). The skill is a legitimate Microsoft Azure RBAC helper that recommends least-privilege roles and generates infrastructure code.

1
الملفات التي تم فحصها
9
الأسطر التي تم تحليلها
0
النتائج
1
إجمالي عمليات التدقيق
لا توجد مشكلات أمنية

الأنماط المكتشفة

Weak Cryptographic Algorithm (False Positive)
تم تدقيقه بواسطة: claude

درجة الجودة

38
الهندسة المعمارية
100
قابلية الصيانة
87
المحتوى
50
المجتمع
100
الأمان
91
الامتثال للمواصفات

ماذا يمكنك بناءه

授與 Blob 儲存體的讀取權限

找出服務主體讀取特定儲存體帳戶中 Blob 所需的最小角色

為 API 權限建立自訂角色

當內建角色太過廣泛時,定義具有特定 API 權限的自訂 RBAC 角色

在 CI/CD 中自動化角色指派

產生可透過 Azure DevOps 或 GitHub Actions 部署的角色指派 Bicep 程式碼

جرّب هذه الموجهات

找出儲存體讀取適用的角色
What is the minimum RBAC role needed to read blobs in an Azure Storage account?
受控識別適用的角色
What RBAC role should I assign to a managed identity so it can list virtual machines in a resource group?
產生角色指派 CLI
Generate the Azure CLI command to assign the Storage Blob Data Reader role to a user-assigned managed identity on a storage account.
建立自訂角色定義
Create a custom RBAC role definition that allows read and list on storage containers and blobs, but not delete or write operations.

أفضل الممارسات

  • 始終在最窄的範圍指派角色(資源或資源群組 vs 訂用帳戶)
  • 盡可能使用內建角色而非自訂角色,以便於維護
  • 記錄每個角色指派的業務理由

تجنب

  • 當有更特定的角色可用時卻指派 Owner 或 Contributor 角色
  • 當資源層級範圍足以滿足需求時,卻在訂用帳戶或管理群組範圍指派角色
  • 在自訂角色定義中使用萬用字元 (*) 權限

الأسئلة المتكررة

Storage Blob Data Reader 和 Storage Blob Data Owner 有什麼差別?
Storage Blob Data Reader 提供對 Blob 和容器的唯讀權限。Storage Blob Data Owner 提供完整權限,包括寫入、刪除和設定 ACL 權限。為達到最低權限,請始終使用 Reader。
我可以將 RBAC 角色指派給受控識別嗎?
是的,您可以將 RBAC 角色指派給使用者指派和系統指派的受控識別。請在角色指派中使用受控識別的 principalId。
如何找出內建角色的角色定義 ID?
使用 Azure CLI:az role definition list --role-name "Storage Blob Data Reader" 來取得 roleDefinitionId(例如 /providers/Microsoft.Authorization/roleDefinitions/2a2b9908-6bc1-4aae-9c59-2c7b10959305)。
我應該使用什麼範圍來進行角色指派?
請使用最窄的範圍。單一資源指派至資源層級,同一群組的多個資源指派至資源群組,只有在需要組織範圍的存取權時才指派至訂用帳戶。
此技能可以協助 Azure AD 權利管理嗎?
不,此技能專注於 RBAC 角色指派。Azure AD Privileged Identity Management (PIM) 和權利管理是獨立系統,不在範圍內。
如何稽核訂用帳戶中現有的角色指派?
使用 Azure CLI:az role assignment list --all --output table 來列出所有指派,或使用 Azure Resource Graph 查詢來進行訂用帳戶範圍的稽核。此技能不提供稽核功能。

تفاصيل المطور

بنية الملفات

📄 SKILL.md