Agent skill

Azure Role Selector

by vinayaklatthe in vinayaklatthe/microsoft-security-skills

Guidance for selecting the right Azure RBAC role with least privilege - mapping required actions to built-in roles, deciding when a custom role is needed, scoping assignments correctly, and choosing…

MITAuto-check passedBackend & APIs

Install Azure Role Selector

skills CLI
$ npx skills add vinayaklatthe/microsoft-security-skills --skill azure-role-selector -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vinayaklatthe/microsoft-security-skills azure-role-selector --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vinayaklatthe/microsoft-security-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/azure-role-selector .claude/skills/azure-role-selector && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-role-selector
GitHub stars
175
Token cost
~2.2k tokens
SKILL.md length
1,027 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Guidance for selecting the right Azure RBAC role with least privilege - mapping required actions to built-in roles, deciding when a custom role is needed, scoping assignments correctly, and choosing…

  • Works in 7 steps: Define the required actions precisely -… → Match the most specific built-in role -… → Decide custom vs built-in - Create a… → …
  • Entra ID directory roles (use entra-id)
  • SKILL.md covers When to use, Pick the right role family, Approach and Guardrails, plus 3 more sections
  • Calls az

What it does

Azure Role Selector is an agent skill from vinayaklatthe/microsoft-security-skills. Guidance for selecting the right Azure RBAC role with least privilege - mapping required actions to built-in roles, deciding when a custom role is needed, scoping assignments correctly, and choosing between control-plane and data-plane roles. Covers scope levels (management group → resource), groups vs direct assignment, and PIM for privileged roles. WHEN: which Azure role, least privilege role, Azure RBAC role selection, built-in vs custom role, scope role assignment, role for managed identity, data plane role…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Authorization and RBAC and Cloud office suites. It works with Microsoft Azure, Microsoft 365 and Microsoft Entra ID. The repository describes itself as: Curated Microsoft Security skills for AI agents - Defender, Sentinel, Entra, Purview, Intune, Security Copilot. The licence is MIT.

When your agent uses it

  • Entra ID directory roles (use entra-id)
  • For Microsoft 365 admin roles (use m365-govern-manage)

Example prompts

  • “/azure-role-selector”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Define the required actions precisely - List the exact operations the principal must
  2. Match the most specific built-in role - Prefer the most specific built-in role whose
  3. Decide custom vs built-in - Create a custom role only when no built-in role fits.
  4. Scope narrowly - Assign at the lowest effective scope: resource > resource group >
  5. Prefer identities and groups - Assign to Entra groups for users (not direct user
  6. Combine with PIM for privileged roles - For Owner, User Access Administrator,
  7. Govern continuously - Run access reviews quarterly on privileged scopes, **remove

What it can do on your machine

Read from SKILL.md and the folder at commit 15f16df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • az

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure Role Selector loads about 2.2k tokens when it runs. Until then it costs about 189 tokens; SKILL.md has 1,027 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~189
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vinayaklatthe/microsoft-security-skills at commit 15f16df, republished under its MIT licence (© vinayaklatthe). 1,027 words, ~2,205 tokens.

Download SKILL.mdSave it as .claude/skills/azure-role-selector/SKILL.md (or your agent's skills folder).
name
azure-role-selector
description
Guidance for selecting the right Azure RBAC role with least privilege - mapping required actions to built-in roles, deciding when a custom role is needed, scoping assignments correctly, and choosing between control-plane and data-plane roles. Covers scope levels (management group → resource), groups vs direct assignment, and PIM for privileged roles. WHEN: which Azure role, least privilege role, Azure RBAC role selection, built-in vs custom role, scope role assignment, role for managed identity, data plane role, assign minimal permissions, RBAC design, control plane vs data plane, Storage Blob Data Reader vs Reader. DO NOT USE for Entra ID directory roles (use entra-id) or for Microsoft 365 admin roles (use m365-govern-manage).
license
MIT
metadata.author
Microsoft
metadata.version
0.1.0

Azure Role Selector (RBAC Least Privilege)

Azure RBAC grants access through role assignments = security principal + role definition + scope. The goal is least privilege: the minimum role at the narrowest scope that meets the need, assigned to the right kind of principal (group for humans, managed identity for workloads), and time-bound via PIM where it is privileged.

When to use

Choosing the correct role for a user, group, service principal, or managed identity - or reviewing existing assignments for excess privilege.

Do not use this skill for:

  • Entra ID directory roles (Global Admin, User Admin, etc.) (use entra-id)
  • Microsoft 365 admin roles (use m365-govern-manage)
  • Activating privileged roles or designing access reviews (use azure-pim)
  • Multicloud entitlement management (use entra-permissions-management)

Pick the right role family

Caller needs to...Look atAvoid
Read storage account propertiesControl-plane: Reader / Storage Account ContributorOwner
Read blob contentsData-plane: Storage Blob Data ReaderReader alone (no data access)
Write blob contentsData-plane: Storage Blob Data ContributorOwner / Contributor
Read Key Vault secrets (RBAC mode)Data-plane: Key Vault Secrets UserKey Vault Administrator
Manage Key Vault itselfControl-plane: Key Vault ContributorOwner
Run an Azure Function with managed identityData role on target resource onlySubscription Contributor
Delegate role assignment to othersUser Access Administrator at narrow scopeOwner
Read everything in a subscriptionReader at subscriptionOwner / Contributor
Manage one resource group onlyContributor at the resource groupSubscription Contributor

Rule of thumb: Control-plane roles do not automatically grant data-plane access. Reader lets you see a storage account exists; it does not let you read a blob. Pick the right plane explicitly. This is the single most common RBAC mistake.

Approach

  1. Define the required actions precisely - List the exact operations the principal must perform. Distinguish control plane (manage the resource: create, delete, list, configure) from data plane (read or write the data inside: blobs, secrets, queue messages, rows). Verify: requirements are written as verbs and resource types, e.g. "read blob contents in container X" rather than "access storage".
  2. Match the most specific built-in role - Prefer the most specific built-in role whose Actions and DataActions cover the need. Built-in roles are maintained by Microsoft and evolve as services add capability. Avoid broad roles (Owner, Contributor) unless genuinely required. Verify: the chosen built-in role's Actions/DataActions cover every required operation and nothing more (use az role definition show).
  3. Decide custom vs built-in - Create a custom role only when no built-in role fits. Define minimal Actions/DataActions and NotActions, version the JSON in source control, and pin assignable scopes. Verify: a custom role exists only after confirming no built-in role covers the need; the JSON is in repo with a change history.
  4. Scope narrowly - Assign at the lowest effective scope: resource > resource group > subscription > management group. A Storage Blob Data Reader at one container is safer than at the storage account, which is safer than at the subscription. Verify: the assignment scope is the smallest that satisfies the requirement; subscription- wide grants for a single resource are flagged.
  5. Prefer identities and groups - Assign to Entra groups for users (not direct user assignments) and managed identities for workloads (not service principals with secrets where avoidable). Group-based assignment scales; per-user assignment does not. Verify: zero direct user assignments at subscription scope; workloads use managed identities, not user accounts.
  6. Combine with PIM for privileged roles - For Owner, User Access Administrator, Contributor at broad scopes, and any custom role with write at subscription scope, require PIM activation (just-in-time, MFA, approval where appropriate, time-bound). Verify: privileged role assignments are Eligible, not Active; activation requires MFA and produces an audit log.
  7. Govern continuously - Run access reviews quarterly on privileged scopes, remove unused assignments detected by Entra Permissions Management or PIM activity reports, and re-baseline when ownership changes. Verify: an access-review cadence is documented; unused-assignment report is reviewed and actioned.
Show full SKILL.md (390 more words)Show less

Guardrails

  • Owner includes the ability to grant access - restrict tightly and prefer User Access Administrator only where delegation is actually needed. Owner is rarely the right answer.
  • Control-plane roles (Reader / Contributor) do not automatically grant data-plane access - choose the data role explicitly. Reader + Storage Blob Data Reader is the correct combo for "see the account and read the blobs".
  • Review and remove unused assignments; pair high-privilege roles with PIM and access reviews. Standing privilege is the attack surface that compounds over time.
  • Custom roles are a maintenance burden - every Microsoft change to the action catalog can break them. Pick built-in unless you genuinely cannot.
  • Group-based, not user-based. Direct user assignments do not scale, do not survive joiner/ mover/leaver, and become orphaned permissions.
  • Managed identity over service principal with secret wherever the target service supports it - no secret to rotate, no secret to leak.
  • Scope at the smallest unit that meets the need. A role at subscription "because it's simpler" is the lazy answer that becomes next year's incident.

Common anti-patterns

  • "They need Owner because Reader does not work for blob data." No - they need Storage Blob Data Reader (data plane). Adding Owner solves the wrong problem.
  • Custom role that mirrors a built-in with one extra action. Build a follow-up assignment for that one action instead of forking a built-in role you now own forever.
  • Per-user assignments at subscription scope. Joiner/mover/leaver leaves orphans; one audit later, the cleanup is a project.
  • Owner / Contributor at subscription for an automation service principal. Blast radius equals the subscription. Scope to the resource group and the data role on the target resources only.
  • Standing Owner roles. If a role is genuinely needed permanently, it usually is not Owner - it is a narrower role. If Owner is genuinely required, it must be in PIM.
  • No access review cadence. Permissions never get smaller without a forcing function.

Example prompts

  • Which built-in Azure role gives least-privilege access to read blob data?
  • Should I use a built-in or custom role for this scenario?
  • Pick the minimal role for a managed identity to access a specific Key Vault secret.
  • How do I scope a role assignment correctly for least privilege?
  • Move privileged Owner assignments into PIM.

Microsoft Learn

© vinayaklatthe, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/azure-role-selector of vinayaklatthe/microsoft-security-skills.

Open the folder on GitHubat commit 15f16df

Compare with similar skills

Azure Role Selector next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure Role Selector compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Role Selector this skillvinayaklatthe/microsoft-security-skills175—~2.2kAutomated safety check: PassMIT
Entra Agent Usergithub/awesome-copilot40k1 repos~2.3kAutomated safety check: PassMIT
Sap Btp Build Work Zone Advancedsecondsky/sap-skills462—~3.3kAutomated safety check: PassGPL-3.0
Detecting Email Account Compromisemukul975/Anthropic-Cybersecurity-Skills34k—~823Automated safety check: PassApache-2.0
Investigating M365 Entratrilwu/secskills157—~4.1kAutomated safety check: PassMIT
Entra Agent Idmicrosoft/GitHub-Copilot-for-Azure2552 repos~4kAutomated safety check: PassMIT

Similar skills

  • Entra Agent User

    github/awesome-copilot

    Official

    Create Agent Users in Microsoft Entra ID from Agent Identities, enabling AI agents to act as digital workers with user identity capabilities in Microsoft 365 and Azure environments.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    Documents & OfficeAuto-check passed
  • Develops and administers SAP Build Work Zone, advanced edition digital workplace solutions.

    462 GitHub stars~3.3k tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Detecting Email Account Compromise

    mukul975/Anthropic-Cybersecurity-Skills

    Detect compromised O365 and Google Workspace email accounts by analyzing Unified Audit Logs and Azure AD sign-in logs for impossible travel, inbox rule creation/deletion (Set-InboxRule…

    34k GitHub stars~823 tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Investigating M365 Entra

    trilwu/secskills

    Investigate security incidents in Microsoft 365 and Entra ID (Azure AD) -- search the Unified Audit Log, correlate sign-in and audit events, trace illicit OAuth consent grants, analyze mailbox rule…

    157 GitHub stars~4.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Entra Agent Id

    microsoft/GitHub-Copilot-for-Azure

    Official

    Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant)…

    255 GitHub starsUsed in 2 repos~4k tokens
    Backend & APIsAuto-check passed
  • Slack To Teams

    microsoft/work-iq

    Official

    Sub-skill of microsoft-365-agents-toolkit. An agent skill from microsoft/work-iq.

    1k GitHub starsUsed in 1 repo~2.3k tokens
    Documents & OfficeAuto-check passed

More from vinayaklatthe/microsoft-security-skills

All 50 skills in this repo
  • API Security Design

    vinayaklatthe/microsoft-security-skills

    Guidance for designing secure APIs on Azure - authentication, authorization, gateway controls, input validation, rate limiting, secret management, and runtime threat detection - aligned to OWASP API…

    175 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure App Service Security

    vinayaklatthe/microsoft-security-skills

    Guidance for securing Azure App Service web apps and APIs — managed identity, Easy Auth with Microsoft Entra ID, network isolation via private endpoints + VNet integration, HTTPS / TLS hardening…

    175 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Arc

    vinayaklatthe/microsoft-security-skills

    Guidance for Azure Arc — projecting on-premises, multicloud (AWS/GCP), and edge servers, Kubernetes, and data services into Azure Resource Manager for unified governance, security, and management.

    175 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Bastion Jit

    vinayaklatthe/microsoft-security-skills

    Guidance for secure remote VM management in Azure using Azure Bastion combined with Defender for Cloud just-in-time (JIT) VM access.

    175 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Confidential Computing

    vinayaklatthe/microsoft-security-skills

    Guidance for Azure Confidential Computing — protecting data in use through hardware-based Trusted Execution Environments (TEEs).

    175 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Ddos Protection

    vinayaklatthe/microsoft-security-skills

    Guidance for Azure DDoS Protection — Network Protection (per-VNet) and IP Protection (per public IP) tiers built on the same always-on Microsoft platform.

    175 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Azure Role Selector

What does Azure Role Selector do?

Guidance for selecting the right Azure RBAC role with least privilege - mapping required actions to built-in roles, deciding when a custom role is needed, scoping assignments correctly, and choosing…. Azure Role Selector is an agent skill from vinayaklatthe/microsoft-security-skills. Guidance for selecting the right Azure RBAC role with least privilege - mapping required actions to built-in roles, deciding when a custom role is needed, scoping assignments correctly, and choosing between control-plane and data-plane roles.

When should I use Azure Role Selector?

Azure Role Selector fits situations like: entra ID directory roles (use entra-id); for Microsoft 365 admin roles (use m365-govern-manage).

How do I install Azure Role Selector in Claude Code?

Run `npx skills add vinayaklatthe/microsoft-security-skills --skill azure-role-selector -a claude-code`. Or copy the skill folder (skills/azure-role-selector in vinayaklatthe/microsoft-security-skills) into .claude/skills/azure-role-selector in your project. Claude Code loads it when a task matches its description.

How do I install Azure Role Selector in Codex?

Run `npx skills add vinayaklatthe/microsoft-security-skills --skill azure-role-selector -a codex`. Or copy the skill folder (skills/azure-role-selector in vinayaklatthe/microsoft-security-skills) into .agents/skills/azure-role-selector in your project. Codex loads it when a task matches its description.

Can I use Azure Role Selector in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vinayaklatthe/microsoft-security-skills --skill azure-role-selector -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-role-selector, .gemini/skills/azure-role-selector, .github/skills/azure-role-selector and .opencode/skills/azure-role-selector in your project.

What does Azure Role Selector need to run?

Going by SKILL.md and its folder, Azure Role Selector needs the command-line tools its instructions call (az).

Does Azure Role Selector access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is Azure Role Selector safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure Role Selector use?

Azure Role Selector is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure Role Selector use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Azure Role Selector?

Skills that share tags, products or a category with Azure Role Selector: Entra Agent User (github/awesome-copilot, 40k stars), Sap Btp Build Work Zone Advanced (secondsky/sap-skills, 462 stars), Detecting Email Account Compromise (mukul975/Anthropic-Cybersecurity-Skills, 34k stars) and Investigating M365 Entra (trilwu/secskills, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Role Selector?

vinayaklatthe (a GitHub user) maintains it in vinayaklatthe/microsoft-security-skills, which has 175 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on June 18, 2026.

Source: vinayaklatthe/microsoft-security-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.