Created on
06-01-2026
03:08 AM
- edited on
06-01-2026
11:14 PM
by
VidyaSargur
Before beginning the key rotation process, ensure the following are in place:
A new, unique key pair must be generated for the rotation.
|
Key Step |
Command (Linux/macOS) |
Description |
|
Generate key |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_new |
Creates a new 4096-bit RSA key pair. |
|
Secure Private Key |
chmod 400 ~/.ssh/id_rsa_new |
Restricts access to the private key. |
|
Get Public Key |
cat ~/.ssh/id_rsa_new.pub |
Displays the new public key contents. |
The new public key must be added to the existing environment under the “Summary” tab in the “Advanced” box at the end of the page.
IMPORTANT: A notification will appear stating that the update only affects new Data Hub deployments. While accurate for initial behavior, this guide later details how to push this updated key to your active FreeIPA, Data Lake, and Data Hub nodes.
Before rotating the old key for the new key, verify that the old key pair grants successful access to the FreeIPA nodes.
ssh -i ~/.ssh/id_rsa cloudbreak@<freeipa_ip_address>ssh -i ~/.ssh/id_rsa_new cloudbreak@<vm_ip_address>This process ensures that even if you have to replace/repair a node in your DL, Environment or Data Hub, the new key will always be used. The old key will not be used anymore.
The process here is the same as for the FreeIPA nodes, but in this case, we will have to navigate to the Data Lake tab and from there follow the same route.
ssh -i ~/.ssh/id_rsa cloudbreak@<datalake_node_ip_address>The process here is the same as for the FreeIPA and Data Lake nodes, but in this case, we will have to navigate to the Data Hub in question and from there follow the same route.
ssh -i ~/.ssh/id_rsa cloudbreak@<datahub_node_ip_address>For enhanced security, remove the old key from the VM if for some reason the salt process failed to do so. If the VM was provisioned using an older key, it may still be in the authorized keys file. The Salt process should have removed it, but better be safe than sorry! You can also validate this by using the old key and checking if it connects or prompts for a password. If the latter happens, this means the key has been unauthorized and removed from the file.
sudo vi /home/cloudbreak/.ssh/authorized_keysAfter a successful rotation, complete the following tasks:
|
Action |
Owner |
Status |
|
Archive old private key |
Person |
Pending |
|
Update Key Rotation Log |
File |
Pending |
|
Schedule next rotation date |
Date |
Pending |
|
Update access documentation |
File |
Pending |
|
Notify team of change |
Calendar event |
Pending |
Automating the rotation workflow is feasible through the CDP CLI. To implement this, follow these structural steps:
# Step 1: Update Environment SSH Key
cdp environments update-ssh-key \
--environment [ENV-CRN-GOES-HERE] \
--new-public-key ["SSH_PUBLIC_KEY_TEXT"]
# Step 2a: Rotate Data Lake Secrets cdp datalake rotate-secrets \
--datalake [DL-CRN-GOES-HERE] \
--secret-types "USER_KEYPAIR"
# Step 2b: Rotate FreeIPA Secrets
cdp environments rotate-freeipa-secrets \
--datahub [DATAHUB-CRN-GOES-HERE] \
--secret-types "USER_KEYPAIR"
# Step 2c: Rotate Data Hub Secrets
cdp datahub rotate-secrets \
--datahub [DATAHUB-CRN-GOES-HERE] \
--secret-types "USER_KEYPAIR"