Skip to content

Conversation

@zhoxing-ms
Copy link
Contributor

@zhoxing-ms zhoxing-ms commented Jan 7, 2022

Description

As the security team raised the security concern: the permission of Contributor is too high to be used as the default role for the creation of VM and VMSS, so the default value Contributor of --role will be removed in the future.

Therefore, the first step is to prompt users that parameters --role and --scope should be passed in at the same time when assigning role to the managed identity to reduce the impact of breaking change.

The specific effects are as follows:
Screenshot 2022-01-07 162306
Screenshot 2022-01-07 163257
Screenshot 2022-01-07 164258

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@zhoxing-ms zhoxing-ms changed the title [Compute] az vm/vmss create: Add warning log and modify help to inform that the default value "Contributor" of "--role" will be removed [Compute] az vm/vmss create: Add warning log and modify help to inform that the default value Contributor of --role will be removed Jan 7, 2022
@yonzhan yonzhan added this to the Jan 2022 (2022-02-08) milestone Jan 7, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 7, 2022

Compute

@zhoxing-ms zhoxing-ms requested a review from jiasli January 7, 2022 09:05
@dbradish-microsoft
Copy link
Contributor

@zhoxing-ms / @yonzhan , can this PR also include updates to _help.py with corrected code samples?

@zhoxing-ms zhoxing-ms force-pushed the prompt_delete_default_role_when_creating_vm branch from 015a513 to 51aa2b7 Compare January 9, 2022 07:09
@zhoxing-ms
Copy link
Contributor Author

@dbradish-microsoft Thank you for your reminder. It has been updated


for scope in ['vm create', 'vmss create']:
with self.argument_context(scope) as c:
arg_group = 'Managed Service Identity' if scope.split()[-1] == 'create' else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope.split()[-1] == 'create' will always be True, right? 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! updated


for scope in ['vm identity assign', 'vmss identity assign']:
with self.argument_context(scope) as c:
arg_group = 'Managed Service Identity' if scope.split()[-1] == 'create' else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here, scope.split()[-1] == 'create' will never be True.

@jiasli jiasli requested review from chasewilson and yonzhan January 14, 2022 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants