azure-role-selector
Recommends built-in Azure roles or custom definitions based on your specific permission requirements.
Install
mkdir -p .claude/skills/azure-role-selector-weiflycc-cmd && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14959" && unzip -o skill.zip -d .claude/skills/azure-role-selector-weiflycc-cmd && rm skill.zipInstalls to .claude/skills/azure-role-selector-weiflycc-cmd
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Recommend least-privilege Azure RBAC roles for deployed resources. Finds minimal built-in roles matching desired permissions or creates custom role definitions. Use during security analysis or when configuring access for service principals and managed identities.Key capabilities
- →Identify least-privilege built-in Azure RBAC roles.
- →Generate Azure CLI commands for role assignments.
- →Create ARM templates for role assignments.
- →Define custom Azure RBAC roles when built-in roles are insufficient.
- →Recommend roles for managed identities and service principals.
- →Provide common role mappings for Azure resources.
How it works
The skill asks for required permissions, searches for matching built-in roles using Azure MCP documentation tools, and then recommends the least-privilege role or suggests creating a custom role.
Inputs & outputs
When to use azure-role-selector
- →Finding roles for storage accounts
- →Defining custom roles for CI/CD
- →Auditing permissions for service principals
About this skill
Azure Role Selector
Recommend the most appropriate Azure RBAC roles following the principle of least privilege. Find minimal built-in roles or define custom roles when needed.
Adapted from github/awesome-copilot azure-role-selector skill.
When to Use
- When deploying resources that need RBAC assignments
- When configuring managed identity access between resources
- When setting up service principals for CI/CD pipelines
- During security analysis to verify correct role assignments
- When user asks "what role do I need for X?"
Procedure
1. Understand Required Permissions
Ask the user what actions they need to perform:
What permissions do you need? Examples:
- "Read and write blobs in a storage account"
- "Deploy code to a Function App"
- "Read secrets from Key Vault"
- "Manage SQL databases"
- "Full access to a resource group"
2. Search for Built-In Roles
Use Azure MCP documentation tools to find matching built-in roles:
# List relevant built-in roles
az role definition list \
--query "[?contains(roleName, '{keyword}')].{Name:roleName, Description:description, Id:name}" \
--output table
# Get detailed permissions for a role
az role definition list \
--name "{role-name}" \
--output json
Cross-reference with Microsoft Docs for the latest role definitions.
3. Recommend Least-Privilege Role
Present the recommended role(s) in order of least privilege:
## Role Recommendation
**Desired:** Read and write blobs in storage account starnwkdhk
### Recommended Role (Least Privilege)
| Property | Value |
|----------|-------|
| **Role** | Storage Blob Data Contributor |
| **ID** | ba92f5b4-2d11-453d-a403-e96b0029c9fe |
| **Scope** | Storage Account level |
| **Permissions** | Read, write, delete blobs and containers |
### Alternatives (More Permissive)
| Role | Extra Permissions | Use When |
|------|-------------------|----------|
| Storage Account Contributor | Full account management | Need to manage account settings too |
| Contributor | Full resource management | Need broad access (not recommended) |
### ⚠️ Avoid These (Over-Privileged)
- **Owner** — Grants RBAC management, not needed for data access
- **Contributor** at subscription level — Too broad for storage-only needs
4. Generate Assignment Commands
Provide ready-to-use commands:
Azure CLI:
# Assign role to managed identity
az role assignment create \
--assignee {principal-id} \
--role "Storage Blob Data Contributor" \
--scope /subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{name}
# Assign role to service principal
az role assignment create \
--assignee {app-id} \
--role "Storage Blob Data Contributor" \
--scope {resource-id}
ARM Template (for inclusion in deployment):
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(resourceId('Microsoft.Storage/storageAccounts', '{name}'), '{principal-id}', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', '{name}')]",
"properties": {
"roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
"principalId": "{principal-id}",
"principalType": "ServicePrincipal"
}
}
5. Custom Role (If No Built-In Matches)
If no built-in role matches the exact permissions needed:
# Create custom role definition
az role definition create --role-definition '{
"Name": "Custom Storage Reader Writer",
"Description": "Can read and write blobs but not delete",
"Actions": [
"Microsoft.Storage/storageAccounts/blobServices/containers/read",
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read",
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
],
"NotActions": [],
"DataActions": [
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read",
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
],
"NotDataActions": [],
"AssignableScopes": ["/subscriptions/{sub-id}"]
}'
Common Role Mappings
| Resource | Action | Recommended Role |
|---|---|---|
| Storage | Read/write blobs | Storage Blob Data Contributor |
| Storage | Read blobs only | Storage Blob Data Reader |
| Key Vault | Read secrets | Key Vault Secrets User |
| Key Vault | Manage secrets | Key Vault Secrets Officer |
| SQL Database | Read data | SQL DB Contributor |
| Function App | Deploy code | Website Contributor |
| App Service | Deploy code | Website Contributor |
| Cosmos DB | Read/write data | Cosmos DB Account Reader Role |
| Resource Group | Full management | Contributor (scoped to RG) |
| Monitoring | Read metrics | Monitoring Reader |
Integration with Git-Ape
When the template generator creates resources with managed identities, invoke this skill to:
- Identify what roles the managed identity needs
- Add role assignment resources to the ARM template
- Follow least-privilege principle automatically
When not to use it
- →The task does not involve Azure RBAC assignments.
- →The user needs to manage permissions for a different cloud provider.
Limitations
- →The skill is specific to Azure RBAC roles.
- →It relies on Azure MCP documentation tools for role information.
How it compares
This skill automates the process of finding and assigning Azure RBAC roles, which is more efficient than manually searching documentation and constructing commands.
Compared to similar skills
azure-role-selector side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| azure-role-selector (this skill) | 0 | 4mo | Review | Intermediate |
| cloud-penetration-testing | 3 | 6mo | Review | Advanced |
| building-cloud-siem-with-sentinel | 0 | 2mo | Review | Advanced |
| azure-cloud-security-review | 0 | 4mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by weiflycc-cmd
View all by weiflycc-cmd →You might also like
cloud-penetration-testing
davila7
This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.
building-cloud-siem-with-sentinel
26zl
This skill covers deploying Microsoft Sentinel as a cloud-native SIEM
azure-cloud-security-review
shyamagu-ms
>
cloud-iam-deep
elementalsouls
Cloud IAM red-team attack chain across AWS, Azure, GCP — focused on EXTERNAL exploitation paths and post-credential-discovery privilege analysis. Covers IAM enumeration (aws iam, az role, gcloud iam), STS/AssumeRole chaining, Azure Managed Identity abuse (via SSRF/leak), GCP service account JSON abu
odoo-image-supply-chain
Insightpulseai
Close container image supply-chain gap with automated ACR builds, vulnerability scanning, and image signing
cloud-defense
transilienceai
Detect and break the cloud post-compromise attack chain (AWS / Azure / GCP) — per-stage CloudTrail / Activity-Log / Audit-Log detection signals and the preventive controls that close each step. Use for cloud detection engineering, hardening, remediation write-ups, or blue-team posture review of the