Defining a custom role for a Subscription or a Management group that allows all actions will give them the same capabilities as the built-in Owner role.
This rule raises an issue when a custom role has an assignable scope set to a Subscription or a Management Group and allows all actions
(*).
To reduce the risk of intrusion of a compromised owner, it is recommended to limit the number of subscription owners.
resource "azurerm_role_definition" "example" { # Sensitive
name = "example"
scope = data.azurerm_subscription.primary.id
permissions {
actions = ["*"]
not_actions = []
}
assignable_scopes = [
data.azurerm_subscription.primary.id
]
}
resource "azurerm_role_definition" "example" {
name = "example"
scope = data.azurerm_subscription.primary.id
permissions {
actions = ["Microsoft.Compute/*"]
not_actions = []
}
assignable_scopes = [
data.azurerm_subscription.primary.id
]
}