Skip to content
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

BUG - Opening apps opened other users jupyterlab servers for me #110

Open
Adam-D-Lewis opened this issue Feb 13, 2024 · 9 comments
Open
Labels
type: bug 🐛 Something isn't working

Comments

@Adam-D-Lewis
Copy link
Member

Adam-D-Lewis commented Feb 13, 2024

Context

I opened the xaitkappv3-d7dff58 app by @kcpevey and the maite-c383ebc by @dharhas and instead of opening the apps, a jupyterlab server was created as if I were kim and dharhas's users. Afterwards, I checked the jhub-apps home page again and the xaitkappv3-d7dff58 and maite-c383ebc apps weren't listed anymore.

Maybe they were deleted, but still shown on jhub-apps home page and when I tried to open them jupyterhub forwarded me to jupyterlab? I'm not sure.

Me as Kim in jupyterhub
image

Me as Dharhas in jupyterhub
image

Value and/or benefit

Bug report

Anything else?

No response

@Adam-D-Lewis Adam-D-Lewis added the needs: triage 🚦 Someone needs to have a look at this issue and triage label Feb 13, 2024
@Adam-D-Lewis Adam-D-Lewis changed the title Opening apps opened other users jupyterlab servers for me BUG - Opening apps opened other users jupyterlab servers for me Feb 13, 2024
@dharhas
Copy link
Member

dharhas commented Feb 14, 2024

The way this works is by impersonating their user, so that part is not surprising. During the lead up to the release we did have weird routing issues where it would start lab instead of redirecting to the url of the 'app'. I don't remember exactly but this was some combination of the version of jupyterhub, jupyterlab and jhsingle-user-proxy that was causing the issue. I thought it was fixed in the release.

cc: @aktech

@aktech
Copy link
Member

aktech commented Feb 14, 2024

weird routing issues where it would start lab instead of redirecting to the url of the 'app'.

This might be the case, will have to check app's creation commands to figure out what went wrong. I'll take a look.

@kcpevey
Copy link
Contributor

kcpevey commented Feb 15, 2024

I just hit this too. My situation:

  • Dharhas had a shared app that had been stopped.
  • I started the app (which led me to confirm I wanted to launch a server)
  • I waited for the server to spin up
  • When the server was up, it redirected me to Dharhas's JLab interface - I was impersonating him.
  • I went back to the app screen and clicked on the App link and it brought me back to Dharhas's Jlab.

We need to disable the ability to have general jupyterlab access and restrict to just the app. There may be some fine grained permissions in JHub/JLab that will allow this now.

@krassowski krassowski self-assigned this Feb 27, 2024
@krassowski
Copy link
Member

krassowski commented Mar 4, 2024

This may be tangential but if user A starts a shared app of user B, but user A only is allowed to spawn say CPU instances, but user B is allowed both CPU and GPU, should user A be allowed to spawn the GPU instance as user B or not? Currently user A can spawn instances that they would have no access to if they were spawning their own app rather than a shared one.

Edit to clarify:

Instances I have access to when spawning as myself Instances I have access to when spawning as Amit
Screenshot from 2024-03-04 13-19-59 Screenshot from 2024-03-04 13-19-42

@aktech
Copy link
Member

aktech commented Mar 4, 2024

IMO the user A ideally should be able to spinup the shared app with only the last saved configuration for the app. They should not be able to change a thing about it like server type, name, thumbnail etc.

Also note that, currently the starting of the shared app won't work as expected due the "fake" sharing ability we have: #138

@krassowski
Copy link
Member

Interestingly the problematic apps disappear from shared apps screen when a server for them gets spawned

before spawning "My panel app" after
image image

But now that you linked #138, it seems to mention the same thing, right?

@krassowski
Copy link
Member

Taking a step back:

How should we scope the work here? It looks like these are 3 tasks which all are critical to ensuring that user data is only shared when explicitly allowed and no impersonation takes place - do I see this right?

@krassowski
Copy link
Member

Just coming back to this issue @aktech did you have a chance to look into this?

@aktech
Copy link
Member

aktech commented Mar 11, 2024

solving #138 would "solve" this issue in the sense of surprising behaviour for end-user, but would not solve the impersonation itself nor too broad permission scopes

Yes, correct.

we can configure "Real-time collaboration without impersonation": jupyterhub.readthedocs.io/en/stable/tutorial/collaboration-users.html - which we could start already

Yes we can, but this is beyond the scope for app sharing requirements.

to only allow access to servers which are actually shared by the author we should use sharing codes jupyterhub.readthedocs.io/en/latest/tutorial/sharing.html which are coming in JupyterHub 5.0

Sharing code is also a good option for sharing temporarily (excellent feature to add later though), but initially we are more interested in sharing non-timebound access with a group or user via: https://jupyterhub.readthedocs.io/en/latest/reference/rest-api.html#operation/post-shares-server

Based on my reading of the sharing feature in JupyterHub 5.0, we will fix this issue after:

Next steps:

  • I am working on writing an issue for implementing app sharing via 5.0, shall have it today.
  • Stop showing all the apps to everyone, remove this basically
    "shared_apps": get_all_shared_servers(
    hub_users=users, current_hub_user=current_hub_user
    ),

Also, there is nothing that needs to be done to fix this one right now, as mentioned it will be fixed by implementing app sharing.

@krassowski krassowski removed their assignment Mar 12, 2024
@Adam-D-Lewis Adam-D-Lewis added type: bug 🐛 Something isn't working and removed needs: triage 🚦 Someone needs to have a look at this issue and triage labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants