-
Notifications
You must be signed in to change notification settings - Fork 564
CNTRLPLANE-2121: Add KMS key rotation section #2000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ approvers: | |
| api-approvers: | ||
| - "@JoelSpeed" | ||
| creation-date: 2025-12-03 | ||
| last-updated: 2026-04-23 | ||
| last-updated: 2026-05-06 | ||
| tracking-link: | ||
| - "https://redhat.atlassian.net/browse/CNTRLPLANE-243" | ||
| see-also: | ||
|
|
@@ -415,9 +415,17 @@ Without this protocol a race can occur: preflight passes for config A, the key-c | |
|
|
||
| Each controller writing its own condition prevents this. If the config changes mid-flight, the key-controller posts a new hash and the preflight controller sees the mismatch and re-runs the check. | ||
|
|
||
| #### Variation: KMS Key Rotation | ||
| #### KMS Key Rotation | ||
|
|
||
| When a KMS plugin rotates its `key_id` (KEK), this triggers neither a new encryption key secret nor a new revision. The mechanism for detecting and handling `key_id` rotation is under evaluation and not covered in this enhancement. | ||
| The KMS plugin returns `Status.key_id`, containing a handle for the active Transit identity. Typically combining address information, transit key version and an identifier for the backing key material, so callers can detect that Transit has moved forward without parsing internals. | ||
|
|
||
| We want to keep using the existing encryption controllers and to avoid issuing extra kube-apiserver static pod revisions whenever Vault rotates outside OpenShift. The obvious approach, minting a new encryption key secret for every rotation and running the usual multi-secret migration, would reuse migration machinery at the cost of revision churn. | ||
|
|
||
| Instead we keep a single encryption key secret per operand and update it in place when the keyId rotates. That breaks the historical one-to-one mapping between encryption key secret name and what the migration state machine treats as the write key, because the secret name no longer advances on an external rotation event. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What are the implications of this? |
||
|
|
||
| We still want migrationController to drive storage migration. For KMS v2 we therefore repurpose internal `WriteKey` so it tracks the KMS plugin `key_id` string rather than equating write identity solely to encryption key secret `metadata.name`. When `key_id` advances, migrationController still observes a write-key transition and can run the existing list and re-encrypt path without requiring a new `encryption-key-kube-apiserver-<n>` resource for that case alone. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The internal WriteKey is not described anywhere else in the design. Is it a field in an internal structure? |
||
|
|
||
| We proprose to add a RotationController. Plugin monitors publish KMS v2 Status `key_id` and health into operator status, scoped per KMS plugin, per API server, and per control-plane instance. RotationController waits until every monitor reports the same new `key_id`, then patches the existing encryption key secret with an annotation holding that value (exact annotation key TBD, for example `encryption.apiserver.operator.openshift.io/kms-key-id`). That annotation is the operator’s durable record of which `key_id` the cluster has committed to. If monitors disagree, the operator should remain progressing and must not advance the annotation. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are nit: s/scoped per KMS plugin, per API server, and per control-plane instance/scoped per KMS plugin, per API server, and per control-plane node/ |
||
|
|
||
| ### KMS Plugin Lifecycle Management (Tech Preview v2) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: pls reword this to make it more kms v2 generic. Vault transit is just an instance of a provider.
for instance: