Any work done to secure prometheus query API and dashboard endpoints with https/TLS

190 views
Skip to first unread message

vvuth...@ebay.com

unread,
Jul 31, 2018, 3:01:40 PM7/31/18
to Prometheus Users
The timeseries data in prometheus is accessible via plain http. Same for the UI Dashboard. Is there a way to secure them with a signed certificate? Seems like Prometheus provides TLS_config to scrape secure targets and also perform client cert auth with those targets if needed. But the access to the timeseries data stored in prometheus itself is left unsecured. We can have workarounds like use a reverse proxy, load balancer etc in front of the prometheus pod/instance and terminate the TLS handling there, but would be nice to secure the pod/instance endpoint itself by configuring a certificate. If there is a way to do this that I am missing from the docs, please let me know.

Ben Kochie

unread,
Jul 31, 2018, 3:07:53 PM7/31/18
to vvuth...@ebay.com, Prometheus Users
This is a discussion topic for our next developer summit.

Currently, the policy is that the server itself does not implement any security.

I'm working to change this.

On Tue, Jul 31, 2018, 21:01 <vvuth...@ebay.com> wrote:
The timeseries data in prometheus is accessible via plain http. Same for the UI Dashboard. Is there a way to secure them with a signed certificate? Seems like Prometheus provides TLS_config to scrape secure targets and also perform client cert auth with those targets if needed. But the access to the timeseries data stored in prometheus itself is left unsecured. We can have workarounds like use a reverse proxy, load balancer etc in front of the prometheus pod/instance and terminate the TLS handling there, but would be nice to secure the pod/instance endpoint itself by configuring a certificate. If there is a way to do this that I am missing from the docs, please let me know.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/d74da52e-6aae-4031-88f5-98afeb1247f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luc Perkins

unread,
Jul 31, 2018, 4:02:03 PM7/31/18
to Ben Kochie, vvuth...@ebay.com, Prometheus Users
FYI, I put together a guide in the official docs for enforcing TLS via an nginx reverse proxy: https://prometheus.io/docs/guides/tls-encryption. It's a very simple setup but it illustrates the important moving parts.

I also put together a few Docker-Compose-based reverse proxy scenarios, both of which enforce both TLS and basic auth:
Let me know if that helps. If not, I'd love to know how I can improve those guides/examples.

vuth...@gmail.com

unread,
Jul 31, 2018, 4:37:27 PM7/31/18
to Prometheus Users
Luc,

Thanks for the pointers. 
Would appreciate what you would suggest in a kubernetes setup where the prometheus instances are pods and are fronted by k8s lb service.  Should we have an nginx reverse proxy as a sidecar in every prometheus pod ? What domain would we use in this case for creating the cert?

vuth...@gmail.com

unread,
Aug 1, 2018, 2:31:57 PM8/1/18
to Prometheus Users
Luc

As shown in attached image, when using the reverse proxy and browsing thru chrome, the UI appears all stripped out
I cannot make any of the buttons or UI work properly. Am I missing something



On Tuesday, July 31, 2018 at 1:02:03 PM UTC-7, Luc Perkins wrote:

vuth...@gmail.com

unread,
Aug 1, 2018, 2:34:19 PM8/1/18
to Prometheus Users

david...@digital.cabinet-office.gov.uk

unread,
Aug 2, 2018, 6:37:03 AM8/2/18
to Prometheus Users
I think that is caused by the prometheus path. I.e you have it pointing to localhost/prometheus as the root. I think the asset are located at localhost/asset, so it might not be able to load the CSS and other things. 

Please check your developer console window to review errors. There might something you can with HA-proxy to resolve this.

david...@digital.cabinet-office.gov.uk

unread,
Aug 2, 2018, 7:10:33 AM8/2/18
to Prometheus Users
--web.route-prefix=<path> this flag should do it for you. 

Start prometheus with it and set the value as /prometheus then it should pick up the static folder.

vuth...@gmail.com

unread,
Aug 2, 2018, 7:33:18 PM8/2/18
to Prometheus Users
Yup. Thanks David.
Reply all
Reply to author
Forward
0 new messages