Prometheus Configuration
When operating a self-managed Prometheus instance, BindPlane's server configuration must be updated to connect to the remote Prometheus instance.
BindPlane Configuration
After installing BindPlane OP, update the configuration file at /etc/bindplane/config.yaml
using the editor of your choice.
- Set
prometheus.enableRemote
totrue
- Set
prometheus.host
to the IP address or Hostname of your Prometheus server.
Once enableRemote
and host
are configured, restart the BindPlane server process.
At this point, BindPlane OP is installed and configured to use the remote Prometheus instance.
Security
Prometheus supports several options for security. Basic authentication (Basic auth), Transport Layer Security (TLS), and Mutual TLS (mTLS).
Basic Authentication
Follow the Prometheus Basic Auth Password Hashing documentation to generate a password hash.
Once you have your hash, update /etc/prometheus/web.yml
with your basic auth username and password
hash.
Restart the Prometheus service.
Test by making a curl request, without basic auth. You should expect a "401 Unauthorized" response.
Test by making a curl request with your username and password.
You should expect a "200 OK" response. This will indicate that basic auth is working correctly.
Next, we need to update BindPlane with the new credentials. Edit /etc/bindplane/config.yaml
on all of
your BindPlane servers.
Restart the BindPlane service.
Transport Layer Security (TLS)
Copy the certificate keypair to /etc/prometheus/tls
. The example commands assume that you have
a certificate key pair in your working directory named prometheus.crt
and prometheus.key
Server side TLS can be configured by editing the web configuration file at /etc/prometheus/web.yml
and configuring the certificate file and private key file paths.
Restart the Prometheus service.
You can test if Prometheus is using TLS by using curl.
You should expect a "200 OK" response. This will indicate that server side TLS is working correctly.
Next, we need to update BindPlane to use TLS when communicating with Prometheus. On all of your servers, perform the following steps.
Copy the certificate authority to /etc/bindplane/tls
. The example commands assume that you have
a certificate authority public key named ca.crt
in your working directory.
Edit /etc/bindplane/config.yaml
on all of your BindPlane servers and add the tls.tlsCa
parameter.
note
Make sure prometheus.host
matches the hostname of the Prometheus server's certificate. If the
hostname does not match, you can set prometheus.tls.tlsSkipVerify
to true
to skip TLS verification.
Skipping TLS verification is not recommended in a production environment.
Restart the BindPlane service.
Mutual TLS
Copy the certificate keypair and certificate authority to
/etc/prometheus/tls
. The example commands assume that you
have a certificate key pair in your working directory named
prometheus.crt
and prometheus.key
and a certificate authority
named ca.crt
.
Mutual TLS can be configured by editing the web configuration file
at /etc/prometheus/web.yml
and configuring the certificate file,
private key file paths and certificate authority paths.
Restart the Prometheus service.
You can test if Prometheus is using TLS by using curl on the Prometheus system.
You should expect a "200 OK" response. This will indicate that mutual TLS is working correctly.
Next, we need to update BindPlane to use mutual TLS when communicating with Prometheus. On all of your servers, perform the following steps.
Copy the certificate authority and client keypair to /etc/bindplane/tls
. The example
commands assume that you have a certificate key pair in your working directory named
bindplane.crt
and bindplane.key
and a certificate authority named ca.crt
.
Edit /etc/bindplane/config.yaml
on all of your BindPlane servers and add the tls
parameters.
note
Make sure prometheus.host
matches the hostname of the Prometheus server's certificate. If the
hostname does not match, you can set prometheus.tls.tlsSkipVerify
to true
to skip TLS verification.
Skipping TLS verification is not recommended in a production environment.
Restart the BindPlane service.