Master Encryption Key Rotation
Overview
When Secret Server is first installed, a unique random AES256 Master Encryption Key (MEK) is generated and saved in a file, encryption.config
. The MEK protects anything sensitive in Secret Server that is not associated with a specific secret, as well as each secret’s unique AES256 key when an HSM is not used.
For added security, you can rotate the MEK, re-encrypting protected data with the new key.
MEK rotation fully supports using a Hardware Security Module (HSM) for Secret Server On-Premises or key management for Secret Server Cloud. This feature requires Enterprise Plus edition or the advanced encryption license. If you are using an HSM, disable it for your first MEK rotation. You can then re-enabled it, and you can run future MEK rotations without disabling it.
Rotation Procedure
To perform a MEK rotation:
-
Important: For Secret Server on Premises, back up the current MEK file
encryption.config
in the application directory on each node.Do not continue until you back up your encryption key. Failure to do so could cause extensive permanent data loss.For Secret Server on Premises, if this is the first MEK rotation, also backup any encrypted session recording videos saved to disk. They are only updated during the very first MEK rotation. Failure to do so could cause extensive permanent data loss. -
Important: For Secret Server on Premises, back up your database. See the first task on the Moving the Microsoft SQL Server Database to Another Machine topic for details.
Do not continue until you back up your database. Failure to do so could cause extensive permanent data loss. -
Go to Admin > Configuration > Security. The Configuration page appears:
-
Click the Security tab.
-
Go to the Master Encryption Key Rotation section (not the Key Rotation section):
-
Click the Rotate Encryption Keys button. The Master Encryption Key Rotation popup appears:
-
Carefully read the text, especially for the check box itself.
-
When you are finished, click to select the check box to acknowledge having read it.
-
Click the Continue button. The server goes into maintenance mode to perform MEK rotation. Secrets and configuration settings cannot be updated while in maintenance mode. Secrets cannot be updated while in this mode. Processing time will vary, depending on the hardware, number of secrets, and HSM key size.
-
The rotation begins.
-
Secret Server updates the
encryption.config
file on the current server. The file now contains the new MEK, as well as the previous MEK, which is needed to re-encrypt all of the data. Theencryption.config
file is only updated on the node you are connected to when you click the Rotate Encryption Keys button, so, depending on whether you have clustered servers, pick one of the following procedures:If you are not running a cluster of On-Premises servers:
- When prompted to restart the IIS application, run
iisreset
to stop and restart the IIS server. - Open Secret Server to restart it.
If you are running a cluster of On-Premises servers:
-
When prompted to restart the IIS server, run command
iisreset /stop
on all nodes in an elevated command prompt. This stops but does not restart IIS on the nodes. -
Copy the
encryption.config
file from the updated node to all other nodes.Note: If you are not sure which node performed the rotation, check the "modified time" of the
encryption.config
files. -
Run
iisreset /start
on all nodes. This restarts IIS on the nodes. -
Open Secret Server to restart it. The first Secret Server node you run continues the rotation process.
- When prompted to restart the IIS application, run
-
The new MEK takes effect, and any new records encrypted use the new key. Any data still using the old key continues to work until the rotation fully finishes.
-
Secret Server's background worker (Secret Server-BWSR.log) enables maintenance mode, preventing changes to secrets and other configuration settings, and continues the rotation process.
-
Secret Server marks the data needing an update in the database and begins rotating everything. A progress bar appears on the Security tab.
-
After all data is rotated except for session recording videos, maintenance mode is disabled.
-
Secret Server's session recording role (Secret Server-SRWSR.log) starts rotating any existing session recording videos encrypted by the MEK. The Last Master Encryption Key Rotation Status text changes to Pending - Encrypting Session Data. Depending on the number of videos, this may take some time. This only applies to the first MEK rotation—further rotations do not update the recordings again.
-
Once the process finishes, the Last Master Encryption Key Rotation Status text changes to Completed - Master Encryption Keys Rotated.