Skip to content

rbac: clarify template access revocation behavior #4501

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

Closed
ammario opened this issue Oct 12, 2022 · 5 comments
Closed

rbac: clarify template access revocation behavior #4501

ammario opened this issue Oct 12, 2022 · 5 comments
Labels
enterprise Enterprise-license / premium functionality stale This issue is like stale bread.

Comments

@ammario
Copy link
Member

ammario commented Oct 12, 2022

We need to clarify the behavior when a developer has access to a template, creates a workspace, and then has their access revoked.

If we let them use the workspace as normal, we introduce a potentially dangerous surprise and limit the power of our group managers. A template/site-admin would have to intervene to reliably kick a user from a workspace.

If we deny the removal until a workspace is deleted, we undermine the authority of the group manager since they do not necessarily have permission to directly delete a member's workspace. We could detect if the group removal operation would also invalidate the users' access to certain workspaces, then allow the group manager to do both removals in one operation. This could lead to an unexpected load spike. For example, a template admin removing a large group could launch hundreds of workspace delete jobs.

Another alternative is a "locked" workspace state. The lock operation is lightweight and reversible. When a workspace is locked, the agent closes all connections and rejects new ones. The Workspace owner is left with two options: they can escalate to an admin/manager to have their workspace unlocked or delete the workspace. A "Lock" state could be helpful in resource cleanup and site-wide user suspension as well.

cc @bpmct @sreya @kylecarbs

@ammario ammario added the enterprise Enterprise-license / premium functionality label Oct 12, 2022
@bpmct
Copy link
Member

bpmct commented Oct 12, 2022

For those curious, this is the current behavior. It is most comparable to a "locked" state but is quite confusing to the user. My workspace and agent are still running so the admin would have to rely on an autostop limit and perhaps some automation with the API if they wanted to delete these workspaces.

Screen.Recording.2022-10-12.at.8.43.34.AM.mov

@bpmct
Copy link
Member

bpmct commented Oct 12, 2022

The third option "locked" sounds like the best approach for the reasons you have outlined 👍🏼

@f0ssel
Copy link
Contributor

f0ssel commented Oct 12, 2022

If we let them use the workspace as normal, we introduce a potentially dangerous surprise and limit the power of our group managers. A template/site-admin would have to intervene to reliably kick a user from a workspace.

If we deny the removal until a workspace is deleted, we undermine the authority of the group manager since they do not necessarily have permission to directly delete a member's workspace. We could detect if the group removal operation would also invalidate the users' access to certain workspaces, then allow the group manager to do both removals in one operation. This could lead to an unexpected load spike. For example, a template admin removing a large group could launch hundreds of workspace delete jobs.

I still need to learn more on how groups works under the hood - but tbh this feels like we have yet to clearly define how the concept of groups and the control of different admin roles interact.

@ammario ammario changed the title Clarify behavior around template access revocation rbac: clarify template access revocation behavior Oct 19, 2022
@sreya sreya removed their assignment Nov 4, 2022
@Emyrk
Copy link
Member

Emyrk commented Jan 2, 2023

Yes, I was aware that orphaned workspaces can be a thing when permissions are revoked.

Orphaned resources are an inevitability. The locked idea is interesting, but I do not think they should be able to delete the workspace. If a user loses permissions to a resource, that means an authority changed their roles. That authority should be notified of the orphaned resources and handle accordingly.

Another reason to not grant delete is that an orphaned resource might be from someone removed from the product entirely and it is the same problem.

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Apr 3, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enterprise Enterprise-license / premium functionality stale This issue is like stale bread.
Projects
None yet
Development

No branches or pull requests

5 participants