Lesson 2 of 14 · 16m
Azure Has Two Permission Systems That Don't Talk to Each Other
Entra ID directory roles govern tenant objects; Azure RBAC governs resources — Contributor's listKeys reaches across the line.
Two systems, one portal
Azure runs two authorization systems side by side, and the portal works hard to make them look like one. They are not.
Microsoft Entra ID — renamed from Azure AD in July 2023 — is the directory. Its roles govern tenant objects: users, groups, app registrations, enterprise applications, OAuth consent grants. Global Administrator, Privileged Role Administrator, User Administrator, Application Administrator, Cloud Application Administrator — those strings say nothing about VMs, storage accounts, or key vaults. An Entra role is a statement about directory objects. Application Administrator, for instance, can add credentials to app registrations — which is itself a stealth escalation path, since app creds mint tokens under the app's permissions.
Azure RBAC is the resource plane. It hangs off the ARM hierarchy — management groups → subscriptions → resource groups → resources — and ships Owner, Contributor, Reader, User Access Administrator, plus per-service roles like Storage Blob Data Reader and Key Vault Secrets User. RBAC splits permissions into actions and dataActions. actions are control plane: create, delete, configure, listKeys. dataActions are the data plane: read a blob, get a secret, pop a queue message. The split that matters: Contributor includes essentially every action except Microsoft.Authorization/* and zero dataActions.
The hole in the middle
Walk the consequence. Grant Contributor on a resource group holding a storage account. Blob reads are denied — no dataActions. But Microsoft.Storage/storageAccounts/listKeys/action is a control-plane action, and Contributor has it. The returned account keys grant every data operation on every container, queue, and table in the account. A principal with "no data access" pulls the master keys and walks through the data plane anyway. This is documented, intended behavior — and the single most common Azure escalation path in pentest writeups.
It compounds. Microsoft.Compute/virtualMachines/runCommand/action — also Contributor — executes a script as root on a Linux VM — SYSTEM on Windows. From there, curl -H 'Metadata: true' http://169.254.169.254/metadata/identity/oauth2/token mints a token for whatever managed identity is attached. Contributor → root → managed identity → whatever that identity's RBAC grants. No SSH, no exploit, no password.
The elevator nobody mentions
Entra and RBAC do intersect — in exactly one intended place. A Global Administrator can toggle "Access management for Azure resources" on their own user — Microsoft's elevateAccess path — and becomes User Access Administrator at the tenant root scope, able to grant themselves any Azure role on any subscription or management group. It is logged, it is by design, and it converts "they're only a directory admin" into "they're one toggle from owning every subscription." Audit elevation events; never treat Entra admin and Azure admin as separate jobs.
Two more RBAC lines auditors miss. Reader sounds harmless — it reads all control-plane configuration at its scope, which historically includes deployment outputs and configuration values holding secrets. And User Access Administrator is the quiet Owner-equivalent: it carries roleAssignments/write, can grant itself any role at its scope, and shows up in assignment lists dressed like a helper account. Management groups multiply all of it — an RBAC assignment on a management group applies to every subscription underneath, so az role assignment list scoped to one subscription misses anything inherited from /providers/Microsoft.Management/managementGroups/... parents.
Land it
Inventory both systems separately: az role assignment list --include-inherited for resources, Entra role assignments for the directory. Use Privileged Identity Management (Entra ID P2 / EMS E5) so Global Admin and Owner are eligible assignments — activated with MFA and approval for a time window — rather than standing grants. Keep two break-glass accounts excluded from Conditional Access, monitored by alerts on their use. And treat Contributor as near-admin wherever it can touch listKeys, runCommand, or a managed identity: the control plane is the data plane's side door.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
AWS Emulator Puts AWS on Your Laptop. Keep Your IAM Tests Off It.
AWS released AWS Emulator on November 11, a free local server that answers AWS API calls on 127.0.0.1 with per-run keys and fresh certificates.
Big Tech Plans to Work with the Public Sector for Cybersecurity
Both Microsoft, Inc. and Alphabet, Inc. will put a combined $30 billion dollars into cybersecurity over the next five years and work with the public sector on several initiatives to help improve cybersecurity.
Zero Trust Everything: The Complete Guide to Self-Hosting Teleport for Secure Infrastructure Access
SudoSecurity runs Teleport internally for everything — admin panel access, secure database connections, Kubernetes, and zero-trust philosophy across our entire team. This is the complete technical guide to installing, configuring, and running your own self-hosted Teleport cluster from scratch.
What is SSRF? Server-Side Request Forgery and the Attack That Breached Capital One
SSRF tricks your server into making requests to internal systems — cloud metadata services, internal APIs, AWS credentials endpoints. It turned a WAF misconfiguration into 100 million stolen Capital One records