DAP Certificate Rotation
Objective
This how-to guide describes the procedure for updating TLS certificates in DAP nodes (Master, Standbys, and Followers).
DAP uses TLS certificates for authentication between nodes. For example, Standbys use a certificate to authenticate with the Master for replicating the Conjur database. The HTTPS connection between API clients and DAP also uses the TLS certificates to provide authentication and data protection.
You must rotate or replace the DAP TLS certificates as part of regular certificate management. For example, when existing certificates are expiring.
Environment
11.7;12.0
Procedure
To rotate the server certificates for the DAP Master, Standbys, and Followers:
Update Master Cluster Certificates (Master and Standbys)
1. Disable Auto-Failover
If your Master cluster uses auto-failover, you must first temporarily disable this feature to prevent an unintended failover from occurring during the certificate replacement process.
To accomplish this, run the following command in the DAP appliance container on each standby to disable the cluster service:
sv stop cluster
The cluster service does not need to be disabled on the active Master.
2. Import the New Master Certificate on each node of the DAP Master Cluster (Master and Standbys)
Import the new DAP Master certificate on the active DAP Master node and each of the Standbys with the following command in the DAP appliance containers:
evoke ca import --force \
--key {Path to certificate private key file}
--set {Path to certificate *.pem or *.crt file}
For example:
evoke ca import --force \ --key /data/ssl/dap_master/dap-master-key.pem --set /data/ssl/dap_master/dap-master.pem"
NOTE: If you also rotate a Standby's private key and use a DAP version prior to 12.1, you must manually update the Postgres client key to re-establish data replication. To accomplish this, run the following command in the DAP Appliance container to re-configure the data replication with the updated key:
evoke replication rebase {Fully qualified DNS name for the active DAP Master}
For example:
evoke replication rebase dap-master-1.mycompany.local
3. Verify the Standbys are Successfully Replicating
Verify the Standbys are successfully connecting to the active DAP Master and replicating by inspecting the health output for the active DAP Master.
Each Standby should be listed under "database"."replication_status"."pg_stat_replication". For example:
$ curl -k https://dap-master.mycompany.local/health
{
"services": {
...
},
"database": {
...
"replication_status": {
"pg_stat_replication": [
{
...
"application_name": "follower_conjur_follower_mycompany_local_0f8185b4ce56",
...
},
{
...
"application_name": "standby_conjur_master_2_mycompany_local_29e228b72782",
...
},
{
...
"application_name": "standby_conjur_master_3_mycompany_local_a084ecf134e4",
...
}
],
...
}
},
"audit": {
...
},
"cluster": {
...
},
"ok": true,
...
}
4. Re-enable Auto-Failover
Once the DAP Master cluster is updated with the new certificates, auto-failover can be re-enabled if was enabled before.
To accomplish this, re-enable the cluster service on each of the Standby nodes by running the following command in the DAP Appliance container:
sv start cluster
Update the Follower Certificates
Follower certificates must be imported into a few different locations described in the following steps.
1. Import the New Follower Certificate on the Active Master and Standbys
The new Follower certificate must be imported into the active DAP Master node in order to allow creation of seed files for the Follower on the active Master. Without this, future Follower seeds will contain the old certificate, rather than the new one.
The certificate must also be imported into each Standby, for the same reason as above if the Standby is promoted to Master.
To accomplish this, run the following command in the DAP Appliance container on the active DAP Master and each DAP Standby:
evoke ca import --force \
--key {Path to certificate private key file}
--set {Path to certificate *.pem or *.crt file}
For example:
evoke ca import --force \ --key /data/ssl/dap_follower/dap-follower-key.pem --set /data/ssl/dap_follower/dap-follower.pem"
2. Import the New Follower Certificate on the Follower
The steps for importing the new Follower certificate into the Follower varies according to the kind of Follower.
2.a. Appliance Follower
If you are using the DAP Appliance container Follower, the new certificate is imported using evoke.
Run the following command in the DAP Appliance container on the Follower node:
evoke ca import --force \
--key {Path to certificate private key file}
--set {Path to certificate *.pem or *.crt file}
For example:
evoke ca import --force \ --key /data/ssl/dap_follower/dap-follower-key.pem --set /data/ssl/dap_follower/dap-follower.pem"
NOTE: If you also rotate a Followers's private key and use a DAP version prior to 12.1, you must also manually update the Postgres client key to re-establish data replication. To accomplish this, run the following command in the DAP Appliance container to re-configure the data replication with the updated key:
evoke replication rebase {Fully qualified DNS name for the DAP Master Load Balancer}
For example:
evoke replication rebase dap-master.mycompany.local
2.b OpenShift Follower
If you are using the DAP Follower for OpenShift. The Follower should obtain the new Follower certificate by requesting a new Seed File.
To accomplish this, terminate each existing Pod in the Follower deployment, one-at-a-time, and allow OpenShift to re-create them using a fresh Follower seed from the seed service.