-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: block user from removing own admin roles #987
fix: block user from removing own admin roles #987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@MaximilianHauer can you review/approve this asap? This is highest priority/security issue for customers. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I request changes to make sure that this PR isn't getting merged until the following conversion is clarified:
Hi @ybidois @shubhamv-ss could you please share for which roles you did observe this?
Under steps to reproduce of #986, you mention the CX Admin role. Which seems expected to me, also for the Company Admin this would be the expected behaviour, if you observe it for any other role, I'd also consider this bug.
Why wouldn't this be a bug for the roles CX Admin / Company Admin?
Thinking it through from a user administration process perspective, it wouldn't make sense for those roles not be able to change their own roles as they are the ones who are allowed to perform the user administration.
If this change gets implemented it would lead to a process where a CX Admin 1 or Company Admin 1 would need to assign the role CX Admin or Company to some other user (CX Admin 2 or Company Admin 2), which would then needed to be asked to change the roles of CX Admin 1 or Company Admin 1, is that really wanted?
And if this process is really wanted, it should be implemented in a secure manner which foremost requires a change in the portal backend, as doing this change in the frontend doesn't prohibit the change directly on the backend.
cc: @MaximilianHauer
Hi @evegufy, CX Admin, Company Admin, and IT Admin currently have the ability to modify their own roles. In our perspective, it's an issue because:
Hence our proposal to restrict self-assignment, and as such, have minimum 1 Admin per company on onboarding and recommend our customers to have minimum two admins. Ex. In Microsoft 365 admin center, global administrators cannot self-assign roles. I definitely agree to your proposal to implement a process that is secure, and maybe with some backend changes. In the short run, preventing self-assignment was the best we could think of 🤔 What do you think? Isn't it better in terms of security? Any advice on how to manage it differently? Again, next week, we're in productive environment. cc: @MaximilianHauer |
The core issue of this topic is the "removability" of Admin roles and therefor the risk of paralyzing the whole company. if you adjust the PR to "grey out the admin roles" and provide a short explanation that the admin is not allowed to remove his- own admin roles by himself i would find it a good in-between solution |
Good solution! @shubhamv-ss can you look into this? |
Hello @MaximilianHauer , @ybidois Screen.Recording.2024-08-21.at.11.21.00.AM.movThe following cases have been covered in this:
|
GOAL: Option 1:
Option 2: this would at least ensure that someone is not removing his own role on fault but would include a 4-eye principle process. current implementation proposal |
Option 1 has a dependency on BE as we don't have API that fetches all users of company with roles. |
Screen.Recording.2024-08-21.at.4.16.48.PM.mov
|
Hi @MaximilianHauer , I think we have to implement this validation in BE also else someone can do this via api as well. |
looks good to me :) |
Hi @MaximilianHauer , @evegufy , |
business approval given , @oyo will have a look on the implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two small changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the PR title and description to what this change is now about?
Updated the description and translation files as suggested. |
Quality Gate passedIssues Measures |
@oyo could you please recheck? |
Description
GOAL:
To ensure that a company can not block itself by removing all Adminroles from their enabled users.
Option 1:
We check how many users in the company have the respective admin role (e.g. CX Admin) and allow the removal only if there are >2 people with this specific role.
Otherwise, the role selector will be greyed out and the tooltip will explain the situation
Option 2:
We grey out all admin roles from a user if he goes into his role configuration.
Only if someone else would try to remove his role this would be possible.
This would at least ensure that someone is not removing his own role on fault but would include a 4-eye principle process.
Option 1 has a dependency on BE as we don't have an API that fetches all users of the company with roles.
So I've implemented the option 2
Why
Issue
Checklist
Please delete options that are not relevant.