Postgres TLS
BindPlane OP supports TLS and mutual TLS when connecting to Postgres.
Prerequisites
This guide assumes you already have BindPlane OP and Postgres deployed and configured. Before following this guide, make sure you have performed the steps in the previous Postgres Store guide.
Lastly, the guide assumes you have already configured Postgres to use TLS or mutual TLS.
SSL Mode
Before configuring TLS, familiarize yourself with the following Postgres SSL mode options. BindPlane supports four SSL mode options.
Mode | Description |
---|---|
disable | TLS is not used. |
require | TLS is used, but does not verify the server certificate. |
verify-ca | TLS is used and verifies the server certificate. |
verify-full | Same as verify-ca , but with mutual TLS and a client TLS key pair is configured. |
You can review the official descriptions here. Keep in mind that BindPlane supports a subset of the options found in the official Postgres documentation.
Linux
When operating BindPlane OP on Linux, you can enable TLS by editing the configuration file at
/etc/bindplane/config.yaml
.
Find the store
section and modify the store.postgres
sub section.
Modify store.postgres.sslmode
to require
or verify-ca
. If using verify-ca
, configure
a certificate authority by setting store.postgres.sslRootCert
to the path of a CA certificate
file that can be used to verify the Postgres server's authenticity.
The resulting configuration file should look similar to this:
note
sslRootCert
is not required when using verify-ca
if the operating system's trust store
includes your CA certificate.
Mutual TLS can be configured by setting sslmode
to verify-full
and including the sslCert
and
sslKey
options.
When copying certificates to the BindPlane server, set the filesystem ownership and permissions.
After you have re-configured BindPlane and deployed the TLS files, restart the service.
Watch the BindPlane log file for issues.
If the service appears stopped, and the log file is not useful, check the journal output of the service.
If no errors are encountered, BindPlane is correctly configured to use TLS when connecting to Postgres.
Kubernetes
The BindPlane OP Helm Chart supports configuring BindPlane to use TLS by leveraging Kubernetes secrets.
Assuming you have the following files:
ca.crt
: The CA certificateclient.crt
: The mutual TLS client certificate (optional)client.key
: The mutual TLS client private key (optional)
Create a Kubernetes secret. Omit the client keypair if you do not intend to use mutual TLS.
Update your values configuration to include the sslmode
and sslsecret
options. Use sslmode verify-ca
and omit the client keypair if you are not using mutual tls.
Upgrade your Helm deployment to apply the changes. The BindPlane pods should restart without startup errors. If the new BindPlane pod(s) enter a crashloop, check their logs to investigate the error. If the pods come up successfully, TLS is configured and working.