Role-Based Access Control (RBAC) in Azure AD
Role-Based Access Control (RBAC) is a system that regulates which users can do what within your Azure environment. Azure AD provides robust RBAC capabilities to manage access to Azure resources, applications, and data.
Core Concepts
- Security Principal: An object that represents a user, group, service principal, or managed identity that is requesting access to an Azure resource.
- Role Definition: A collection of permissions. For example, a "Reader" role has permissions to view everything, but not to make changes.
- Scope: The level at which access is granted. This can be at the management group, subscription, resource group, or individual resource level.
- Role Assignment: The process of granting a Security Principal a Role Definition at a specific Scope.
Common Azure AD Roles
- Global Administrator: Has access to all administrative features and all data in Azure AD.
- User Administrator: Can manage users and groups, but not all administrative features.
- Service Support Administrator: Can open support requests with Microsoft.
- Reader: Can view all Azure resources, but cannot make any changes.
Assigning Roles
You can assign roles to users, groups, or service principals through the Azure portal, Azure CLI, Azure PowerShell, or programmatically using the Microsoft Graph API.
Azure Portal Example:
- Navigate to the Azure portal and select the resource or scope you want to manage access for.
- In the left-hand menu, select "Access control (IAM)".
- Click "Add" and then "Add role assignment".
- Select the desired role from the list.
- Choose the members (users, groups, etc.) you want to assign the role to.
- Click "Save".
Azure CLI Example:
az role assignment create --assignee <user-principal-name> --role "Reader" --scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>"
Best Practices
- Follow the principle of least privilege: Grant only the necessary permissions.
- Use Azure AD groups to manage role assignments, rather than assigning roles directly to individual users.
- Regularly review role assignments to ensure they are still necessary.
- Leverage built-in roles where possible, and create custom roles only when necessary.
- Consider using Privileged Identity Management (PIM) for just-in-time (JIT) access to sensitive roles.
For more in-depth information, refer to the official Azure RBAC documentation.