Rotate the encryption key
Use the key rotation utility to replace the encryption key that Itential Platform uses to protect secrets. The utility decrypts the encrypted values in your database with the old key and re-encrypts them with a new key.
To migrate encrypted secrets from an earlier Platform version, instead use the key migration utility.
Before you begin
Before you rotate the key, complete the following tasks:
- Back up your MongoDB database. The utility modifies the database directly, so Itential recommends a backup before every rotation. If the rotation is interrupted, restore the database from your backup and run the utility again. For instructions, see Back up MongoDB data.
- Gather the following items:
- The current encryption key.
- The new encryption key.
Rotate the key
In a high availability environment, stop all Platform instances before you rotate the key. Run the utility once, and update the configuration for every Platform instance before you start any of them.
Stop Platform
The utility can’t run while Platform is running. For more information, see Start, stop, and restart Platform.
Run the key rotation utility
Run the command that matches how you configure Platform. Replace $OLD_KEY with your current encryption key and $NEW_KEY with your new encryption key.
-
If you use a
platform.propertiesfile, run the following command: -
If environment variables fully define your configuration, run the following command. Use
--only-envin place of--config-file.
Rotate custom collections (optional)
If you have custom collections that contain encrypted values, add them with --extra-collections. Repeat the option for each collection.
Command options
The key rotation utility supports the following options:
Choose which collections to rotate
By default, the utility rotates the following collections:
service_configsoauth_clientsaccountsiap_profilesitential_provider_profilesitential_agent_sessions
To add collections to this list, use --extra-collections.
To rotate a specific set of collections instead, use --only-collections. The utility then rotates only the collections that you specify. It ignores the default collections and any collections that you pass with --extra-collections.