title: key-encryption-key-rotation
Target version: 1.11.1
Currently, Rook encrypts the PVCs backing OSDs with dm-crypt using cryptsetup with LUKS extension. The Key Encryption Key (KEK) can be stored in various Key Management Systems (KMS) that Rook supports such as Kubernetes Secrets, HashiCorp Vault, IBM Key Protect and Key Management Interoperability Protocol (KMIP).
Rook needs to be able to periodically rotate the KEK, update it simultaeously in both the encrypted device backing OSD and the KMS, to enhance security. This proposal describes how Rook will implement this feature.
The changes required and the workflows are described in the following sections:
requiredDuringScheduling
using the OSD's labels as selector to run on the same node as the OSD.Support for KMS.UpdateSecret()
needs to be added for each KMS type. This will be used to update the KEK in the KMS.
K1 - current KEK in KMS; K2 - new KEK to be added to KMS.
Step | Operation | Luks Slot 0 | Luks Slot 1 | Key in KMS |
---|---|---|---|---|
1 | Obtain K1 | K1 | K1 | |
2 | Add K1 to slot 1 | K1 | K1 | K1 |
3 | Create K2 & add to slot 0 | K2 | K1 | K1 |
4 | Update K2 in KMS | K2 | K1 | K2 |
5 | Remove K1 from slot 1 | K2 | K2 |
Note: The above steps will ensure the KEK in kms will be able to open the encrypted device even if the operation is disrupted at any step and all the edge cases occurring from disrupted processes are handled.
luksAddKey, luksChangeKey, luksKillSlot
commands will be used to achieve this.
Following new section security.keyRotation
will be added to cephcluster spec to enable and configure the key rotation.
security:
keyRotation:
enabled: "true"
schedule: "@weekly"