nebari-dev / nebari

🪴 Nebari - your open source data science platform
https://nebari.dev
BSD 3-Clause "New" or "Revised" License
281 stars 93 forks source link

[META] Permissions overhaul #2304

Open aktech opened 8 months ago

aktech commented 8 months ago

Context

This is a meta issue to define and document problems with the current permissions model in Nebari

Nebari Permissions

🛡️Authentication

Login / Logout to Services or Components

Application Authentication Required? Login Behavior Logout Behavior
Keycloak Yes - -
Monitoring Yes Logs in automatically if logged in to Nebari Nebari Home logout doesn't logs you out of Monitoring
VSCode / JupyterLab Yes Logs in automatically if logged in to Nebari Nebari Home logout logs you out of VSCode/JupyterLab
conda-store Yes Requires another login (via Keycloak) Redirects to localhost after logout, no actual logout (conda-store bug?)
Argo Yes Requires another login (via Keycloak) Nebari Home logout doesn't logs you out of Argo
Dask Diagnostics Dashboard No (Accessible without auth) N/A N/A
Extenstions (e.g. mlflow) don't care yet don't care yet don't care yet

🛡️Authorization

Permission Profiles (JupyterLab Profiles)

profiles:
  jupyterlab:
    - display_name: Small Instance
      description: Stable environment with 1 cpu / 1 GB ram
      access: all
      default: true
      kubespawner_override:
        cpu_limit: 1
        cpu_guarantee: 1
        mem_limit: 1G
        mem_guarantee: 1G
    - display_name: Medium Instance
    ...

Permissions via Keycloak

Groups

This also gives users the access to right groups in the jupyterhub shared filesystem, if a user is in above groups, they will have access to following shared directories in /shared:

drwxrwxrwx  5 0 0 4.0K Jan  4  2023 developer
drwxrwxrwx  2 0 0 4.0K Apr 12  2023 superadmin
drwxrwxrwx 14 0 0 4.0K Sep 26 16:37 quansight
drwxrwxrwx  4 0 0 4.0K Feb 14 12:34 analyst
drwxrwxrwx  2 0 0 4.0K Feb 27 13:37 admin

When a use spins up a JupyterLab server, it fetches the groups the user is in via Keycloak API and mounts those directories for the user.

Roles

Conda Store

JupyterHub

Argo

Keycloak

Grafana

Dask

References:

Problems / Concerns / Questions:

Translation of levels of access between Nebari permissions and respective services permission

Role Mapping (just an idea):

jupyterhub-role:create-share=quansight jupyterhub-role:no-create-share conda-store-role:env:quansight:read conda-store-role:env:quansight:write

Value and/or benefit

Anything else?

No response

aktech commented 7 months ago

An RFD has been created for the RBAC implementation: https://github.com/nebari-dev/governance/issues/47

viniciusdc commented 6 months ago

The RFD above has been accepted, and the work referenced in this issue and in the RFD itself has been broken down in the following issues: