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

Scraping password/bearer protected targets found via service discovery #2614

Closed
smarterclayton opened this Issue Apr 12, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@smarterclayton
Copy link

smarterclayton commented Apr 12, 2017

Not all possible metrics targets are safe to expose without auth, and while a ScrapeConfig can carry bearer or user/password auth info for retrieving targets protected by auth, it's not currently possible for a service discovery endpoint to do the same via relabel configuration.

For Kubernetes and OpenShift, it would be extremely desirable to allow the existing Kubernetes endpoint collector to also retrieve a bearer token or username/password from the annotations of the service. While this does encourage some undesirable behavior (placing unencrypted secrets into Kubernetes annotations), in general even for security-conscious multi-tenant clusters this is reasonably safe, because the tenant can secure the metrics endpoint with a different "shared secret" than the rest of their service. We can't safely allow Prometheus to access Kubernetes secrets in a multi-tenant environment (that would allow Prometheus to escalate), and if the choices are between no metrics, unsecured metrics, and metrics that are visible to someone in the management console, most users would choose the latter.

Would Prometheus accept a PR to allow specific labels (possibly __bearer_token__, __basic_auth_username__, __basic_auth_password__, and maaaybe __proxy_url__) to be accepted from relabelling into the http client passed to the scraper, so that discovered services could also specify some minimal parameterization?

@smarterclayton

This comment has been minimized.

Copy link
Author

smarterclayton commented Apr 12, 2017

@fabxc we discussed this at KubeCon briefly.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Apr 12, 2017

Dupe of #1176

If you can create a shared secret that's insecure for everything, you can put that in a k8 config.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 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.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.