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

Distribution changes the way it handles token validation in the next release (>v2.8.3) #237

Open
shaunco opened this issue Dec 14, 2023 · 0 comments

Comments

@shaunco
Copy link

shaunco commented Dec 14, 2023

Distribution moved from the long archived libtrust to go-jose on Oct 19, 2023 in this change:
distribution/distribution@fe21f43

This will be in whatever release comes out after the current v2.8.3 release (from Oct 2, 2023). Looking at the changes to https://github.com/distribution/distribution/blob/main/registry/auth/token/accesscontroller.go and https://github.com/distribution/distribution/blob/main/registry/auth/token/token.go - it would appear that there is no longer a need for the libtrust style KID and that if a KID is included in the JWT, then there MUST be a JWKS file (rather than a rootcerts file ... and no support for JWKS URLs yet) set up in the config to associate each JWK with a KID for lookup.

Specifically, see:
https://github.com/distribution/distribution/blob/b8fb08e0a14646eb5439fa7915e017cb1176c173/registry/auth/token/token.go#L141-L153

The simple fix is for open-balena-registry to also also pull in the KID environment variable, add an confd template to generate a jwks from from the KID+CERT, and then update the docker-registry.yml.tmpl template to have a jwks entry pointing to the jwks file rather than a rootcertbundle line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant