Skip to content

Commit 8b72d88

Browse files
Update PingData cert rotation doc to use replace-certificate (#407)
BRASS-516
1 parent b2b82c7 commit 8b72d88

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

docs/reference/usingCertificates.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The following examples explain how to deploy a certificate/PIN combination to an
2525

2626
## PingData Image Certificates
2727

28-
The PingData products, such as PingDirectory, PingDataSync, PingAuthorize, and PingDirectoryProxy, use a file location to determine certificates/PIN files:
28+
The PingData products (PingDirectory, PingDataSync, PingAuthorize, and PingDirectoryProxy) use a file location to determine certificates/PIN files:
2929

3030
* It is best practice to use a non-persistent location, such as /run/secrets, to store these files.
3131
* If no certificate is provided, the container/product will generate a self-signed certificate.
@@ -59,8 +59,44 @@ The default location for certificates and associated files are listed below, ass
5959
CERTIFICATE_NICKNAME=development-cert
6060
```
6161
## PingData image certificate rotation
62+
The certificate rotation process for PingData products varies depending on which product is being configured and whether that product is in a topology. For products that are not in a topology, certificates can be rotated by simply updating the environment variables. For products in a topology, certificate rotation must be done via a command-line call with the servers in the topology online.
6263

63-
As mentioned above, for the PingData products there are variables for truststore and keystore. To change certificates, you will need to update the contents of the truststore or keystore in your server profile or secret store. After you update the contents, restart the container. The changes will be picked up automatically when the server restarts. If you have multiple certificates in the keystore, you can use the above-mentioned CERTIFICATE_NICKNAME variable to specify the certificate. The container will pick up that certificate from those stored in the keystore. For updating the product to use the new certificates, perform a rolling update. This action ensures that other servers will remain available as each pod is cycled. In addition, verify that remaining pods in the cluster have sufficient capacity to handle the increased load during the rolling update.
64+
### Rotating the listener certificate by adjusting environment variables
65+
The process described in this section can be used for PingAuthorize, PingDirectoryProxy, and *standalone* (single-server) instances of PingDirectory or PingDataSync.
66+
67+
!!! warning
68+
If PingDirectory or PingDataSync is deployed with multiple servers, use the process described in the next section.
69+
70+
As mentioned above, for the PingData products there are variables defining the server truststore and keystore. To change certificates, you will need to update the contents of the truststore or keystore in your server profile or secret store. After you update the contents, restart the container. The changes will be picked up automatically when the server restarts. If you have multiple certificates in the keystore, you can use the above-mentioned CERTIFICATE_NICKNAME variable to specify the certificate. The container will pick up that certificate from those stored in the keystore. For updating the product to use the new certificates, perform a rolling update. This action ensures that other servers will remain available as each pod is cycled.
71+
72+
!!! note "Rolling Update"
73+
Verify that remaining pods in the cluster have sufficient capacity to handle the increased load during the rolling update.
74+
75+
### Rotating the listener certificate with the replace-certificate command-line tool
76+
If multiple PingDataSync or PingDirectory servers are running in a topology, then the servers must be online when updating the listener certificate. Updates to certificates with one or more servers offline (such as rolling updates) can lead to connection issues with the other members of the topology when those servers come back online. Use the PingData `replace-certificate` command-line tool to update certificates with the server online.
77+
78+
Shell into the running instance that needs to be updated, and ensure the keystore containing the needed certificate is mounted on the container. Then, run `replace-certificate`. Replace the `--key-manager-provider` and `--trust-manager-provider` values if necessary when using a non-JKS keystore, as well as the `--source-certificate-alias` value if necessary.
79+
80+
```
81+
replace-certificate replace-listener-certificate \
82+
--key-manager-provider JKS \
83+
--trust-manager-provider JKS \
84+
--source-key-store-file /run/secrets/newkeystore \
85+
--source-key-store-password-file /run/secrets/newkeystore.pin \
86+
--source-certificate-alias server-cert \
87+
--reload-http-connection-handler-certificates
88+
```
89+
90+
For more information on this command, run
91+
```
92+
replace-certificate replace-listener-certificate --help
93+
```
94+
95+
Running the first command will replace the listener certificate and notify other servers in the topology that this server's certificate has changed.
96+
97+
To update certificates for the other servers in the topology, follow this same process, shelling into each individual instance.
98+
99+
Once this is done, the running pods have been updated. To ensure a restart does not undo these changes, verify that your server profile and orchestration environment variables are updated to point to the new certificates. For example, if you have modified your server configuration to point to `/run/secrets/newkeystore`, then you must update your KEYSTORE_FILE environment variable to point to that new keystore *after* you have completed the `replace-certificate` process on each server.
64100

65101
## Non-PingData image certificates
66102

0 commit comments

Comments
 (0)