| name | cis-azure-foundations-5.23 |
| description | Ensure no custom subscription administrator roles exist |
| category | cis-azure-foundations |
| version | 5.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","identity","rbac","custom-roles","least-privilege","subscription"] |
| cis_id | 5.23 |
| cis_benchmark | CIS Microsoft Azure Foundations Benchmark v5.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | ["cis-azure-foundations-5.24","cis-azure-foundations-5.27"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure no custom subscription administrator roles exist
Description
The principle of least privilege should be followed and only necessary privileges should be assigned instead of allowing full administrative access.
Rationale
Custom roles in Azure with administrative access can obfuscate the permissions granted and introduce complexity and blind spots to the management of privileged identities. For less mature security programs without regular identity audits, the creation of Custom roles should be avoided entirely. For more mature security programs with regular identity audits, Custom Roles should be audited for use and assignment, used minimally, and the principle of least privilege should be observed when granting permissions.
Impact
Subscriptions will need to be handled by Administrators with permissions.
Audit Procedure
Using Azure Portal
- From Azure Home select the Portal Menu.
- Select
Subscriptions.
- Select a subscription.
- Select
Access control (IAM).
- Select
Roles.
- Click
Type and select Custom role from the drop-down menu.
- Select
View next to a role.
- Select
JSON.
- Check for
assignableScopes set to the subscription, and actions set to *.
- Repeat steps 7-9 for each custom role.
Using Azure CLI
az role definition list --custom-role-only True
Check for entries with assignableScope of the subscription, and an action of *.
Using PowerShell
Connect-AzAccount
Get-AzRoleDefinition | Where-Object {($_.IsCustom -eq $true) -and ($_.Actions.contains('*'))}
Check the output for AssignableScopes value set to the subscription.
Using Azure Policy
- Policy ID: a451c1ef-c6ca-483d-87ed-f49761e3ffb5 - Name: 'Audit usage of custom RBAC roles'
Expected Result
No custom roles should exist with assignableScopes set to the subscription and actions set to *.
Remediation
Using Azure Portal