-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Bug]: bearer authentication required on /metrics #2149
Comments
@seniorquico |
@alexstan12 can you answer this pls? |
We encountered another bearer auth incompatibility example... We setup one zot server to which we push a lot of images, and we setup a second zot server that we hoped to configure as a pull-through image cache. Unfortunately, the sync plugin appears to only support HTTP basic authentication. Having bearer auth enabled, we cannot use the sync plugin.
@rchincha Yes, but we have an existing system for issuing bearer auth credentials according to the Token Authentication Specification. It is working incredibly well, aside from the limitations imposed by not supporting other "fallback" authentication methods.
Can't the |
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate @seniorquico Currently, we return only one "auth-scheme". In theory, multiple WWW-Authenticate (w auth-scheme) should be possible, however, not sure if clients will break if we did that. @peusebiu maybe we can evaluate? |
My comment was too narrowly focused on the request side... Handling this disambiguation on the response side is tricky! Feel free to keep me posted if there's any way for our team to get more engaged on this issue. |
opencontainers/wg-auth#12 |
The sync plugin in v2.0.3 now works with bearer authentication thanks to #2222. That particular use case is now no longer a concern and works very well with our token issuance service based on the Token Authentication Specification. This is awesome, thanks @peusebiu! The original problem- @rchincha @peusebiu Is there any update on what may be done to get Prometheus working with zot when it is configured with bearer authentication? The only other alternative I can brainstorm is to create a localhost proxy server, just for Prometheus to call, that implements the bearer auth workflow and returns the |
The same goes for the availability handles - startupProbe, etc I set up authorization through github, eventually probe can't get the data due to 401 error |
zot version
v2.0.0
Describe the bug
The
/metrics
endpoint requires authentication thanks to #1895.However, when Bearer authentication is configured, no other authentication methods are supported simultaneously:
This breaks our Prometheus metric pulling client (we use Netdata, but also tried with Prometheus). The client gets
401 Unauthorized
, and they appear to have no support for the Token Authentication Specification (which seems reasonable).To reproduce
/metrics
.401 Unauthorized
challenge, requiring a JWT bearer token.Expected behavior
In the authentication docs, the LDAP section includes this comment:
It's not really a fail-safe in this instance, but it would be awesome if zot supported simultaneous configurations of JWT bearer and HTTP basic/
htpasswd
for compatibility with clients that do not support the Token Authentication Specification.Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: