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

Basic Auth support #3

Open
v4rakh opened this issue Jan 24, 2023 · 5 comments
Open

Basic Auth support #3

v4rakh opened this issue Jan 24, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@v4rakh
Copy link

v4rakh commented Jan 24, 2023

Hi, thanks for providing this. Would it be possible to have basic auth support in and being able to set user and pass via env var?

@ngosang ngosang added the wontfix This will not be worked on label Feb 2, 2023
@ngosang
Copy link
Owner

ngosang commented Feb 2, 2023

You mean in the /metrics endpoint?

@v4rakh
Copy link
Author

v4rakh commented Feb 2, 2023

Yes, exactly.

@ngosang
Copy link
Owner

ngosang commented Feb 2, 2023

The purpose of this exported is to be consumed by Prometheus. I never saw an exporter with basic auth and I think the prometheus client does not support it.
If you are worried about unauthorized access to the endpoint, you can do it with network policies. If you are using Docker containers it's even easier. Anyway there is no much to be worried about, the info exposed is not sensitive.

Btw, new release is out => https://github.com/ngosang/restic-exporter/releases/tag/1.1.0

@ngosang ngosang closed this as completed Feb 2, 2023
@v4rakh
Copy link
Author

v4rakh commented Feb 2, 2023

@ngosang The /metrics endpoint which is being scraped and the scraping being configured in the prometheus.yml allows to specify basic auth in that configuration. A lot of the exporters allow to secure the exposed metrics endpoint, like the default node-exporter or the node-systemd-exporter.

I'd imagine that it might be useful. Sure, I can solve it with network, but for a simple setup, maybe basic auth is just enough.

But OK, if that's nothing you'd consider, then there's nothing I can do. :-)

@ngosang
Copy link
Owner

ngosang commented Feb 2, 2023

You are right. It's supported by the python client library and Prometheus. I didn't know about that.
I'm not interested in implement this feature but I can accept PRs.
Example code => https://github.com/prometheus/client_python#handlers-for-authentication

@ngosang ngosang added enhancement New feature or request help wanted Extra attention is needed and removed wontfix This will not be worked on labels Feb 2, 2023
@ngosang ngosang reopened this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants