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

Propagate Basic Authentication #322

Closed
philipfoulkes opened this issue Jul 4, 2020 · 3 comments · Fixed by #480
Closed

Propagate Basic Authentication #322

philipfoulkes opened this issue Jul 4, 2020 · 3 comments · Fixed by #480

Comments

@philipfoulkes
Copy link

I'm running Promxy as shown below. Promxy talks to two Prometheus instances, which sit behind NGINX. NGINX does TLS termination and basic authentication. We authenticate individual users in NGINX for Grafana and Prometheus.

                            => NGINX => Prometheus
NGINX => Grafana => Promxy
                            => NGINX => Prometheus

In Grafana, it's possible to pass the user's credentials to the data source. When I configure Prometheus as the data source in Grafana, I select With Credentials (as shown below), and Grafana passes the logged-in user's credentials through to NGINX/Prometheus, and all works well.

image

It would be nice if it was possible to send the logged-in user's credentials to Promxy (from Grafana), and then Promxy pass these along to NGINX/Prometheus. I see when I pass the credentials from Grafana to Promxy, Promxy does not pass the details along. For now, I've configured a set of credentials in Promxy, so that I can authenticate against NGINX for Prometheus.

I think it would be useful to control this behaviour of passing credentials via a flag.

@jacksontj
Copy link
Owner

First off, welcome :)

Second off, I totally agree that this would be a useful feature. It shouldn't be too hard to add, just need a middleware to capture the headers and then an option to pass them downstream. I'm not sure when I'll have time to knock this out myself, but I'll be happy to when I get some time. If anyone is interested in submitting a PR for this I'd be more than happy to review :)

@philipfoulkes
Copy link
Author

Thank-you for the welcome @jacksontj. And thanks for Promxy. It's a great companion to Prometheus!

I'd be happy to submit a PR. I did have a brief look at the code, but I need to find a bit more time to understand how it all fits together. I see there's a weekend coming up...

@philipfoulkes
Copy link
Author

Thanks for adding this feature @jacksontj

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

Successfully merging a pull request may close this issue.

2 participants