-
Notifications
You must be signed in to change notification settings - Fork 1k
Limetime management for OIDC JWKS #10620
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
Comments
(3) is probably the right approach. At minimum, we're going to need:
|
WIP branch is here: https://github.com/trailofbits/warehouse/tree/tob-jwk-management Some outstanding design questions:
|
I went ahead and did this on the branch -- we cache JWKs under the You can smoke-test this with: docker-compose run --rm web python -m warehouse oidc update-oidc-jwks
docker-compose run --rm web python -m warehouse oidc list-jwks --provider github |
There's the potential for a brief window here where a new public key has been published to the JWKS but we haven't fetched it yet, and as a result signature verification will fail with legitimate signatures. Perhaps it be better to fetch the JWKS whenever we attempt to verify a JWT that has a This behavior works with cold-starts (the first verification with no JWK in cache causes us to reach out and get the entire JWKS) and this ensures we always have the latest keys before failing. To avoid these requests becoming abusive we could only repeat a request for a previously nonexistent |
That sounds good! And yeah, that provides nice self-starting behavior (much better than having to jumpstart things with a CLI command on each startup.) We'll want to make sure that we preserve provider-first identification with these changes -- a previously unknown
Sounds good. In that case we'll probably want an additional self-expiring KV in Redis for the cooldown window. A cooldown of even just 60s is probably more than sufficient. |
The first step in verifying the OIDC JWTs is verifying their signatures, which means checking them against the OIDC provider's signing key set.
There are a few approaches we could take to acquiring and maintaining the updatedness of those keys:
openid-configuration
.The text was updated successfully, but these errors were encountered: