[Release-1.22] Secrets-encryption rotation #4654
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #4372
Documentation can be found at https://rancher.com/docs/k3s/latest/en/security/secrets_encryption/
Signed-off-by: Derek Nola [email protected]
Proposed Changes
Introduces new feature: secrets-encryption keys rotation and enable/disable of encryption. The is all controlled via a new sub command
k3s secrets-encrypt
.Types of Changes
New Feature
New Integration Test (covers single node)
Verification
Formal documentation to follow:
You can run
k3s secrets-encrypt status
at any time to see the current stage/state of encryptionFor a single node cluster:
k3s server --secrets-encryption
k3s secrets-encrypt prepare
k3s secrets-encrypt status
, note, the addition of a new keyk3s secrets-encrypt rotate
k3s secrets-encrypt status
, note the keys swapk3s secrets-encrypt reencrypt
For external DB:
Start up a external DB (I used mySQL for this)
Start up 3 K3s servers joined to mySQL
k3s server --secrets-encryption --datastore-endpoint "mysql://root:mysql@tcp(192.168.1.200:3306)/k3s"
Select ONE server (S1 going forward) to perform the rotate on (doing any stage on any server is supported)
Run
k3s secrets-encrypt prepare
on S1Restart S1 with same arguments
Once S1 is back up, restart the other two servers
Call
k3s secrets-encrypt status
on S1 and S2, info should be the same on bothRun
k3s secrets-encrypt rotate
on S1Restart S1
Once S1 is back up, restart the other two servers
Call
k3s secrets-encrypt status
on S1 and S2, info should be the same on bothRun
k3s secrets-encrypt reencrypt
on S1Restart S1
Once S1 is back up, restart the other two servers
Call
k3s secrets-encrypt status
on S1 and S2, info should be the same on bothLinked Issues
#4602
User-Facing Change
Further Comments