-
Notifications
You must be signed in to change notification settings - Fork 96
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
Better secret support for PAT, LLM keys, etc #2514
Comments
Thanks for opening the issue, @krassowski. I think, your original intention with this issue was to target the use cases of the new extension and their access tokens present as env vars right? (due to them being serviced?). Though, as @Adam-D-Lewis pointed out above, we also have more general solution to the overall secret management conversation, that could be interesting as a secodna point of view. In any case, I think (b) would've been the best approach. However, besides your appointed problem, there are many indirect dependencies in the user and system permissions within the user pod itself that other dependent services (such as conda-store or dask) could interact with, leading to possible issues later on, so I too, would like to avoid touching it if possible. I also like the first option, (a), as it seems more manageable at first glance and, at least to me, follows a mico-segmentation workflow standard. I would like to know more on what are the requirements to get into that if possible, as my perspective on this matter is heavily oriented to k8s itself. |
Something potentially related: https://github.com/danilopeixoto/jupyterhub-ai-gateway |
I managed to add a second (sidecar) container with additional access to secret mounts in the user pod (option a). It's working 🎉 For now it runs the same jupyterhub singleuser server. Because it is on the same network and with the same token, user is able to access it with jupyter-server-proxy. Now there is a couple of more things to take care of
|
Because jupyter-gallery would now run in a separate sidecar container we need to redirect API calls. There are two solutions:
I lean slightly towards the latter to hide the implementation detail from the app and avoid having to display settings for Another advantage of (2) option is that we can also add a rule blocking any other traffic to proxy on the chosen port. The downside is that it will be a tad harder to debug when things go wrong - if someone was to remove this rule, the extension would appear to be partially working because it would be hitting the endpoint in the main container (although it would not be getting any config). |
Also, with (2) we could apply the same to extensions which we do not control (like jupyter-ai) where we cannot change the endpoint easily. |
While running the full server app in a sidecar is easy, it is not currently possible to make it load only one selected extension (here
Until we hear from upstream on whether they would accept a patch I think the best way forward is to run the |
I had quite some success with applying the JupyterHub patches to jupyter-server spawned by gallery in standalone mode. The one last thing which does not work is the progress bar as proxying of SSE is not yet supported by |
This sounds like a better approach to me as well. |
Status update: |
Feature description
Currently any secrets passed down to the single-user Jupyter server via configuration or environment variables can be discovered by the user. This is usually not a problem if these tokens are well scoped, or in case of model keys - have appropriate billing limits/controls. This is not always possible.
Value and/or benefit
jupyterlab-gallery
use case)jupyter-ai
use case)Anything else?
This is a follow-up to #2501.
Possible solutions
I would need to explore it a bit further but while technically feasible, (b) appears not worth the trouble because changing the user identity via
SETGID
may be insecure.The text was updated successfully, but these errors were encountered: