Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[Feature request] HTTP Basic auth from file #3639
Comments
This comment has been minimized.
This comment has been minimized.
|
At present all secrets bar the bearer token must come from the configuration file, it is expected that you'll get your configuration management system to write them out while writing the rest of the file. |
This comment has been minimized.
This comment has been minimized.
|
Hi, Thank you for answering so quickly! Our configuration management system (helm) runs on a Jenkins machine, which does not have access to any secrets (except the permission to publish Images) - which I imagine is a common set-up - this is by design since a lot of people have access to Jenkins. The actual runtime environment does not matter much, but I also imagine that it is a common practice to only have secrets distributed with the minimum amount of access, and in this case only a few people may read or write secrets in our Kubernetes cluster. Will you accept pull requests for the proposed change, or is this a matter of philosophy for Prometheus? If you accept pull requests, I might work on it. Again, thank you! |
This comment has been minimized.
This comment has been minimized.
|
The suggested way to handle this is to have the secrets interpolated into the config before you start Prometheus, for example you could do it with Configuration management doesn't end at Helm, it goes all the way down to starting the binary. So this could include for example running a few commands before starting Prometheus. Adding arbitrary headers is unlikely to be accepted (makes debugging too hard), nor are custom auth schemes (too niche, we recommend using a proxy for the rare time this comes up). |
This comment has been minimized.
This comment has been minimized.
|
I understand your point, but I am specifically asking about I understand your wanting to keep the code base neat and simple, but since you have allowed Thanks! |
This comment has been minimized.
This comment has been minimized.
|
That's something that would require broader discussion. If we were to have it it'd be |
bbzg
closed this
Dec 31, 2017
This comment has been minimized.
This comment has been minimized.
juliantaylor
commented
Feb 27, 2018
|
I would second the request for providing basic auth credentials via a file. |
This comment has been minimized.
This comment has been minimized.
t3h2mas
commented
Jun 13, 2018
|
Thirded, should a ticket be open for asking for the |
This comment has been minimized.
This comment has been minimized.
|
This was added in 2.3.0. |
alexellis
referenced this issue
Jan 21, 2019
Closed
Support for environment variable substitution in configuration file #2357
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
bbzg commentedDec 30, 2017
Hi,
First of all: thank you for your great work with the Prometheus eco system. Very well done.
After struggling for a couple of hours I realized ("read the code") that
bearer_token_fileprependsBearerto theAuthorizationheader.What I want to do is to provide basic auth through a Kubernetes secret. The problem is that the only way to provide basic auth in Prometheus (that I can find?) is to write it verbatim in the config file, which I don't want to do. (And it does not seem like Prometheus supports supplying those credentials as run-time parameters / environment variables.)
When I think about it, the Prometheus configuration variables should have been named
authorization_headerandauthorization_header_file? That way one could have put anything in there: Basic, Bearer... whatever floats one's boat. Or even more generic, justheaderand the user could use any form of auth, even Cookies...That is not the case though, and I realize changing it would break compatibility so it would be nice if Prometheus could supply at least a
basic_auth_filewhere one could supply a Base64(username:password) string to be used inutil/config/config.go.Thank you for considering my use-case.
Best Regards