"Secure" the Blackbox exporter using basic authentication

207 views
Skip to first unread message

Cres Portillo

unread,
Jan 25, 2024, 9:28:52 AM1/25/24
to Prometheus Users
Hello Everyone,

I'm trying to "secure" a bit the BlackBox exporter site running on http:\\localhost:9115 using basic authentication, or whatever is available. I'm not able to find any info on doing this. Hoping someone can point me in the right direction.

I have successfully done this for hosts using Windows Exporter.
I added the following to the web.yml on the Windows Exporter host.

basic_auth_users:
    admin: bcryptpassword 


and added the creds to the job in prometheus.yml on Prometheus server. 

- job_name: "server1"
    static_configs:
      - targets: ["server1:9182"]
    basic_auth:
      username: 'admin'
      password: ' secure'


It works for Windows Exporter. 
Can't figure out how to do the same for Blackbox Exporter. 

Any ideas? Thanks in advance. 




Brian Candler

unread,
Jan 25, 2024, 10:20:18 AM1/25/24
to Prometheus Users
Please read the documentation here: https://github.com/prometheus/blackbox_exporter?tab=readme-ov-file#tls-and-basic-authentication

> To use TLS and/or basic authentication, you need to pass a configuration file using the --web.config.file parameter. The format of the file is described in the exporter-toolkit repository.

Reply all
Reply to author
Forward
0 new messages