-
Notifications
You must be signed in to change notification settings - Fork 122
Option to support a shared secret token auth scheme #189
Comments
That seems good even on the wide open version. Whatever frontend is around can provide these as temp tokens. |
Missed your drift here. /me slurps more coffee |
drift is right, sorry. I was thinking that tmpnb can require tokens no matter what and the version at try.jupyter.org just gives them out freely. |
Hmm. Does that mean there's a new endpoint for requesting a token too? My brain is stuck on the bootstrap process. The silly simple KISS implementation in kernel gateway generates a token on gateway startup and requires sharing it out-of-band (e.g., I tell you the key and you put it in your app.) |
That makes sense. Each container/notebook server gets their own token on boot I presume? |
Or is this a token for just requesting a kernel to begin with? |
Ok, reading over, that's the case here. |
Realtime chat in github issue! Yes. The latter. But the former is a follow on for sure. To summarize:
The stopgap for 2. is make the two API keys the same. If you can request a container, you can talk to any container. Single tenant story. |
Occurs to me as I'm coming back to this that we may not even need the second API key. The URL itself already has a key of sorts in the form of the unique user ID. If the length of the user ID is made configurable and random.SystemRandom().choice is used instead, it should act as a reasonably secure key when used programmatically. |
Right now, the tmpnb spawn, stats, etc. end points are wide open for anyone to request access to a new container. This is great for open deployments, not so great for cases where only certain actors should be allowed to request containers. An optional API key scheme would do the trick here. I suggest keeping with what we did in jupyter-server/kernel_gateway#3, generate a single shared token on startup, log it, require it in the form:
I'll probably wind up tackling this in a PR. Opening it so I don't forget. Did discuss it briefly with @rgbkrk
The text was updated successfully, but these errors were encountered: