Azure / Azure/azure-rest-api-specs
Management Groups - List - doesn't honor managementGroups/read permission in custom role
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
The [Management Groups - List](https://docs.microsoft.com/en-us/rest/api/resources/managementgroups/list) call does not seem to honor the `Microsoft.Management/managementGroups/read` permission if it is used in a custom role, but works fine using the built-in `Management Group Reader Role` which has the same permission defined.
When using the custom role and creating a role assignment for it for a service principal in the root tenant management group the list call returns no results. However if I instead create a role assignment using the built-in role, it returns results.
It should also be noted that the `Get` and `Get Descendants` calls still work fine with the custom role even though the `List` call does not. Additionally, I've tried this at other levels of the Management Group hierarchy with the same results.
This is the custom role I am attempting to use:
``` json
{
"Name": "Custom Management Groups Role",
"Id": null,
"IsCustom": true,
"Description": "Provides read access to Management Groups",
"Actions": [
"Microsoft.Management/managementGroups/read"
],
"NotActions": [],
"AssignableScopes": [
"/providers/Microsoft.Management/managementGroups/{TENANT ID}"
]
}
```
Contributor guide
Research direction
Start with the Management Groups - List REST API documentation linked in the issue and compare its authorization behavior with the Get and Get Descendants calls. Reproduce the request using the supplied custom role and the built-in Management Group Reader Role; done means List returns the same management-group results when Microsoft.Management/managementGroups/read is granted through the custom role.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, authorization, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100