-
Notifications
You must be signed in to change notification settings - Fork 321
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
Empty auth-scheme support #349
Comments
I agree that we should support an empty auth scheme. Ideally, we can go with the solution you proposed, although I'm not sure if bearer token configurations expect no string to be "Bearer", because if so we would have to come up with something else in order to avoid breaking backward compatibility. |
I do think the opposite. The type is mandatory. Accepting something else would be confusing. Here is the page I used when designing this: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization |
Unfortunately reality is more complicated than expectations. As we know already, there are many systems avoiding log4shell by not updating from v1 ;) Also there are many vendor systems that expect raw token in
And it is possible to workaround this via prometheus config:
But in this case token in plain text is displayed in |
the intersection between vendors not following rfc's and supporting prometheus is too small at the moment to consider exceptions like this upstream. |
please let's set an empty value for the type |
For proxies you need to use proxy headers which dont have that limitation.
Le jeu. 5 janv. 2023, 11:31, nuved ***@***.***> a écrit :
… please let's set an empty value for the type
right now I have to set a proxy up and add a header there and ask
Prometheus for scrapping that endpoint.
—
Reply to this email directly, view it on GitHub
<#349 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHHJQHXZWRLTMGTDJ35X3WQ2PHPANCNFSM5KO26M6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@roidelapluie BTW, we have to set up a proxy and add the header of Authorization there because Prometheus can't add a simple header like this one . |
@roidelapluie please reconsider. authorization stanza could be full general for Authorization request header value, with basic_auth the convenience alternative. Relax this validation: Line 346 in ccc2474
Already authorization.credentials_file allows a path that could be a mounted Secret. If authorization.type validation is relaxed, this solves a case where the remote requires Basic auth with a secret username and no password. Almost all bytes on Authorization request header are user controlled. Please allow full control. |
Another case when authorization.type is unnecessary and does not allow data to be collected normally https://grafana.com/docs/oncall/latest/oncall-api-reference/ |
What did you do?
I want to scrape target secured via
Authorization
header, curl example:Per docs i should be able to not use
Bearer
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config
So i've set:
But in tcpdump i still see that
Bearer
prefix is added before token.Validation code:
common/config/http_config.go
Line 232 in f57586d
What did you expect to see?
I expect to being able to choose any auth-scheme, including
nil
one.What did you see instead? Under which circumstances?
I see that
Bearer
auth-scheme is forced, i.e.:instead of:
Environment
This could be fixed by verifying that
type
is explicitly set to empty string before callingTrimSpace
. I can send PR if such a solution is fine.The text was updated successfully, but these errors were encountered: