-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[prometheus] Securing Prometheus API and UI endpoints using basic auth in Container #1255
Comments
Any updates here? |
Basic auth is fairly easy to enable server:
extraArgs:
web.config.file: /etc/config/web_config.yml
serverFiles:
web.config.yml:
basic_auth_users:
user: 'bcrypt password' The issue is that is also enable basic authentication on endpoints used for liveness and readiness probes, resulting in the pod being killed. Would be great to describe an idiomatic way to secure prometheus. |
Thanks. |
Thanks. I have tried this earlier but as mentioned ,the pods were not working post helm upgrade with these changes.(401 error) |
|
Hi,any updates here? |
Hi, What would be the best way to add basic auths? |
I have the same problem, while it doesn't get fixed I'm using basic auth at the ingress level. prometheus:
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required' As described here. |
i have done the same stuff. Strange, why Prometheus inbuilt feature is not working here. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
This issue is being automatically closed due to inactivity. |
FYI - for whomever might still be looking for a solution for this, it seems a workaround is now supported in Prometheus Helm chart >= 14.10. Via support for custom headers (which can be used to autheticate the healthchecks), it was imeplemented here - 0d69e90 and merged here - #1422
Where the user and pass are base64 encoded in format user:pass and sent as an Authorization header. |
ok, this is great news.I will check the implementaions |
Thanks @burizz , I confirm combining
|
Has anyone found a workaround for this or we need to wait for |
How does this work with kube-prometheus-stack? |
Seconding @mindrunner 's question since |
Hey @cykl @prab2014 @burizz I was facing this same issue and found out one typo mistake that we are making
If you noticed the web.config.file we are creating or putting the data is web_config.yml + while in serverFiles we are specifying web.config.yml. This is what the small mistake we were making pasting correct code_snip
|
This is the full working solution (version 15.5.0):
If you deep dive into deployment template, you'll see that |
It might be useful to get the base64 user:pass value from a secret instead. |
Below is my content from values.yaml
|
I am unable to find any parameters with serverFiles in the kube-prometheus-stack values.yaml Where can we enable authentication for prometheus using the kube-prometheus-stack helm chart and what parameters need to be updated on values.yaml. Could anyone please help on this |
hey is it possible to implement this basic auth in prometheus.yaml that are provide istio,if it is please tell me the process |
Hi folks, recently I have tried to implement basic auth using configurations provided above: Chart version: 19.3.3 values.yml
P.S I've tried with and without '' around credentials. Config don't work for me ( |
Hi All, Anyone has any update on above? I am trying to put the authentication on the prometheus server and would like to make it work for the kubernetes cluster. |
Hey everyone, |
It took me so much time to investigate this issue. I finally figured it out with the guidance above from taskovskig A simple example could explain everything.
If the username=test, and password=test,
and 'base64 ${prometheus_admin_user_password}' should be generated like this:
result: dGVzdDp0ZXN0 Thus, the configuration block that fully works for me is:
|
Team,
I am running Prometheus on containers using helm chart prometheus-community/prometheus .
Chart - https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus
Need to add basic authentication in prometheus to secure the UI and API endpoints . I am following the docs "https://prometheus.io/docs/guides/basic-auth/" and "https://prometheus.io/docs/prometheus/latest/configuration/https/" for the same .
Have created the web.yml file with basic auth settings .
I am not able to do helm upgrade as not sure how to set the flag "web.config.file" in prometheus . On local environment i can easily do this by restarting the prometheus and running the below command
Tried below upgrade commands but it doe not work as expected
helm upgrade --set-file web.config.file="C:\prometheus\prometheus\web.yaml" --reuse-values [release] prometheus-community/prometheus -n "namespace"
helm upgrade --set-file extraFlags.web.config.file="C:\prometheus\prometheus\web.yaml" --reuse-values [release]prometheus-community/prometheus -n "namespace"
.\prometheus. exe --web.config-file == "my web.yml file path"
Prometheus version - 2.26
valu.yml = https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/values.yaml
Any help/suggestion would be great here.
The text was updated successfully, but these errors were encountered: