-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
JWT validation fails after EKS OIDC provider's key rotation #1260
Comments
I opened a PR with the upgrade, do you mind testing with your environment? |
Cheers Nick :), I deployed it for testing but now I don't seem to be able to verify tokens from multiple issuers. We've got EKS and Okta issuer audience pairs set using
Error comes from: https://github.com/coreos/go-oidc/blob/15b94d97d90c9455981dbdd90a021d34254cfdaf/oidc/verify.go#L245 |
Ignore the above ^ comment, when I rolled back to v7.1.3 the same was happening (issuing a new token fixed this). I'm running your version now and will keep you posted, it can take up to a week for a the EKS key rotation issue to occur :) cheers |
Pretty confident the patch worked 👍, although because I don't know precisely when the rotation happened there's a slim chance the EKS key rotation could of happened in a 40 minute window between the last service account JWT use and the pod being evicted to another node, but it seems small :) cheers |
Thanks for circling back! I'll merge the PR |
Any ETA on when the next patch release is scheduled for :) cheers |
@NickMeves Any update on when a patch release is due? cheers |
We've got a couple more PRs we want to merge before the next release, we are aiming for mid september currently |
We're using EKS service account tokens to authenticate via OAuth2 proxy. When the EKS OIDC provider rotates it's keys the OAuth2 proxy/go-oidc client does not update it's key set causing some tokens to fail with: "Error retrieving session from token in Authorization header: unable to verify jwt token". The key ID from the failing token matches exactly with the freshly added key.
Expected Behavior
OAuth2 proxy key set should be in sync with the EKS OIDC provider, so that all service account token can be validated.
Current Behavior
The EKS OIDC provider returns "cache-control: max-age=604800" in the http header, go-oidc sets 7 days expiration for each remoteKeySet and does NOT fetch keys even if it cannot find a key in the remoteKeySet meaning that authenticated using a token generated from freshly rotated keys fails with: "Error retrieving session from token in Authorization header: unable to verify jwt token".
Possible Solution
version v2.2.1 of go-oidc library contains a bug regarding key rotation strategy which has been solved in v3.0.0, upgrade dependency.
Version used
v6.1.1 (master uses the same go-oidc version), we've now upgraded to v7.1.3 in preparation for a patch release.
The text was updated successfully, but these errors were encountered: