Skip to main content

Azure role-based access control

Azure role-based access control (RBAC) decides what a principal may do at a scope: a role assignment joins a principal, a role and a scope. The Azure Enterprise Baseline keeps every standing assignment for people in one matrix, grants it to Entra groups only, and narrows it from the sandbox toward production.

What it does​

A role definition lists allowed actions (control plane, through Azure Resource Manager) and dataActions (data plane, such as reading a blob or a secret), with notActions carved out. A role assignment grants one role to a user, group or service principal at a scope: a management group, a subscription, a resource group or a resource. Assignments inherit downward. Built-in roles such as Owner, Contributor and Reader cover the control plane; data planes have their own roles, such as Key Vault Secrets User or Storage Blob Data Reader. A custom role defines its own action list, and a condition (attribute-based access control, ABAC) can narrow an assignment further, for example to one blob path.

How BuiltForProd uses it​

The access matrix. The entra-rbac unit holds every standing assignment in two maps of modules/entra-rbac/main.tf: standing, always applied, and admin, standing only while Privileged Identity Management (PIM) is off. Each entry is a group, a role and a scope. The read-only role set is Reader, Log Analytics Reader and Monitoring Reader.

GroupCoreSandbox, devStagingProd
Platform LeadsOwner and Security Admin at mg-acme (admin)via mg-acmevia mg-acmevia mg-acme
Platform EngineersContributor at mg-acme-coreContributorContributorRead-only set
DevOps LeadsRead-only set at mg-acme-coreOwner at mg-acme-plat (admin)samesame
DevOps EngineersRead-only set at mg-acme-coreContributorContributorRead-only set
Lead App, ETL and AI developersnoneContributorContributorthrough All Engineers
App, ETL and AI developersnoneContributornonethrough All Engineers
All EngineersnonenonenoneRead-only set
Security Auditors, Lead Security AuditorsSecurity Reader and acme-security-auditor at mg-acme; the leads also Reader and Log Analytics Readerinheritedinheritedinherited

Humans get access through these groups only: a custom policy in the security guardrails initiative denies any role assignment whose principal type is User, below mg-acme.

Kubernetes access. Owner and Contributor carry no Kubernetes data actions, so the matrix grants the Azure Kubernetes Service (AKS) data-plane roles separately, and a group's Kubernetes access never exceeds its Azure access to the same stage:

GroupSandbox, devStagingProd
Platform Leads, DevOps LeadsRBAC Cluster AdminRBAC Cluster AdminRBAC Cluster Admin
Platform EngineersRBAC Cluster AdminRBAC Cluster AdminRBAC Reader, Cluster User Role
DevOps EngineersRBAC WriterRBAC WriterRBAC Reader, Cluster User Role
Lead App, ETL and AI developersRBAC WriterRBAC Writerthrough All Engineers
App, ETL and AI developersRBAC Writernonethrough All Engineers
All EngineersnonenoneRBAC Reader, Cluster User Role

The two lead groups hold Cluster Admin at mg-acme-plat, standing even while their Owner is eligible through PIM; every other grant is per stage subscription. The auditor groups and ACME_BreakGlass hold no Kubernetes role. The Azure Kubernetes Service Cluster User Role carries the one action az aks get-credentials needs, which neither Reader nor RBAC Reader includes, so every reader on prod can fetch credentials and then only read.

Custom roles. Three are defined at mg-acme:

RoleDefined inWhat it allows
acme-security-auditorentra-rbacRead security, policy, Key Vault, storage, network, monitoring and cluster configuration; no data actions
acme-blueprint-deployergithub-oidcEvery action, locks and policy assignments included, except role, deny-assignment and policy-exemption changes, elevate access, subscription cancel or enable and a few sharing actions
acme-tfstate-prefix-contributorstate-backendRead, write, add and delete blobs of the tfstate container, with no container actions

The blueprint infrastructure identities hold acme-blueprint-deployer on the four stage subscriptions, plus Role Based Access Control Administrator with a condition that allows creating or deleting assignments of an allow-listed set of roles only. They hold acme-tfstate-prefix-contributor with an ABAC condition that limits every blob action to their own key prefix, apps/app-blueprint/ or apps/etl-blueprint/. The Baseline identity and Platform Leads hold Storage Blob Data Contributor on the whole container and Platform Engineers Storage Blob Data Reader. GitHub OIDC describes the pipeline identities.

Terms you will see​

TermMeaning
Role assignmentA principal, a role and a scope; the unit of access in Azure.
Data actionA data-plane permission, such as reading a secret; Owner and Contributor have none.
Read-only setReader, Log Analytics Reader and Monitoring Reader, granted together.
standing, adminThe two maps of the access matrix; admin moves to PIM when PIM is on.
ABAC conditionAn expression that narrows an assignment, such as a blob path prefix or a role list.

Where to read more​