Open iameskild opened 2 years ago
Love this issue :heart:. I've already implemented most of this logic before in qhub-hpc the "on prem systemd nebari" which we haven't spent as much time on https://github.com/Quansight/qhub-hpc/blob/2f9e6f75fefae20bedf47608b7a474b779475da0/roles/jupyterhub/templates/jupyterhub_config.py#L68-L105. However there are significant improvements we can make on this code in nebari. The one that stands out to me is that we make the jupyterhub keycloak oauth2 client capable of being a service account. This will allow jupyterhub to use it's oauth credentials to modify users/groups without admin credentials (which we never should have been doing in the first place).
Steps that I see:
High level we need to store a unique uid
attribute associated with each user and unique gid
attribute for each group that the user is a member of. The code above shows how to store these attributes. The trick is that you have to ensure that the uids are unique and gids are unique. I guess collisions aren't that bad but since we can avoid them we should. We should avoid randomly generating the ids to maximize the stability of uids when users are removed/added back. Also a fixes set of uid/gids should be protected. E.g. less than 1000000.
When user launches a jupyterlab cluster we need to ensure:
Complications that could maybe be addressed in a separate PR. Would this break things?
The sync_users
function looks great!
I think the larger question of how we manage users and groups is tied into this discussion:
@iameskild good points. Maybe we take advantage of the group all read permission. This would allow us to have a file
user/group/all
xrw/xrw/xr
I think we need to discuss this one more.
At the end I think this should behave like linux permissoining since this would be the easiest to explain. I think as a default we should use the unix model of when a user creates a file it is user writable and group readable.
@aktech is this done by your recent permissioning work?
Feature description
Currently anyone who has access to a particular shared folder, say
~/shared/<my_folder>
, has either complete R/W access or the folder is hidden from them. It would be great to enable scoped access to this folder such that one privileged user has R/W access while another less-privileged user only has R.Value and/or benefit
This would make the filesystem behave more like the linux filesystem (though not exactly). Enabling this kind of scoped access allows admins and managers to shared important data without fear that it will be modified.
Anything else?
This is based on a conversation that @viniciusdc @costrouc and I had recently.