{Role} az ad sp create-for-rbac: Show warning when --scopes defaults to subscription#20965
{Role} az ad sp create-for-rbac: Show warning when --scopes defaults to subscription#20965
az ad sp create-for-rbac: Show warning when --scopes defaults to subscription#20965Conversation
|
Removing the default value of |
| if role and not scopes: | ||
| logger.warning(SCOPE_WARNING) | ||
| scopes = ['/subscriptions/' + role_client.config.subscription_id] |
There was a problem hiding this comment.
Unlike #20924, the default value assignment is done in our own custom function, instead of letting knack assign the default value and set is_default.
|
Just out of curiosity, ask another related question: If users do not pass in |
|
@yonzhan / @chasewilson , Why do we have hidden defaults anywhere? Can't we handle all defaults with a I do like @zhoxing-ms 's question and would like to put in my vote for a 2nd warning message. Although it doesn't seem logical to |
In the future, this usage will trigger an error. |
Description
A temporary warning for #20806
For
az ad sp create-for-rbac, when--roleis given,--scopedefaults to the subscription:Without explicit consent from the user on the
--scope, this behavior is considered Elevation of Privilege.This PR adds a warning when
--roleis specified but--scopesis not: