Feat/spiffe machine identity key encryption key rotation#2136
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
3dc23c1 to
688abf2
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-2136.docs.buildwithfern.com/infra-controller |
…y rotation inconsistancy
…bug fix and refactor
dc093d9 to
596d0ff
Compare
Description
Adds site master encryption key (KEK) rotation for SPIFFE machine identity. Operators can change
[machine_identity].current_encryption_key_id, re-wrap existingtenant_identity_configciphertext via a new admin gRPC, and rely on envelope-embeddedkey_idinstead of a redundant DB column.encryption_key_id— Migration removes the column; decrypt useskey_idin the AES-GCM envelope JSON; new encrypts use sitecurrent_encryption_key_idfrom config/secrets (machine_identity.encryption_keys).Forge.ReencryptTenantIdentitySecretsRPC — Site-operator API (Forge Admin CLI) re-wrapsencrypted_signing_key_1,encrypted_signing_key_2, andencrypted_auth_method_configfor one org or all orgs; supportsdry_runfor validate-only runs.current_encryption_key_id— Echoes the site key used as the re-wrap target so dry-run output is self-explanatory (e.g. already onkv2vs still onkv1).SELECT */RETURNING *ontenant_identity_configwith explicit column lists to avoid PostgreSQL “cached plan must not change result type” errors after schema migrations.docs/design/machine-identity/spiffe-svid-sdd.md(§3.1.1 KEK rotation workflow, API reference, proto.Commits (#847)
cc0376b97encryption_key_id; envelope-driven decryptcdab380458d7215e4cReencryptTenantIdentitySecretsAPI3dc23c1dfcurrent_encryption_key_idresponse field; SQL refactor; SDDKey files
crates/rpc/proto/forge.protocrates/api-core/src/handlers/tenant_identity_config.rscrates/api-core/src/machine_identity/crypto.rscrates/api-db/src/tenant_identity_config.rscrates/api-db/migrations/20260528120000_drop_tenant_identity_encryption_key_id.sqldocs/design/machine-identity/spiffe-svid-sdd.mdOperator workflow (post-merge)
machine_identity/encryption_keys/kv2); keep the old key.current_encryption_key_id = "kv2"and restartcarbide-api.ReencryptTenantIdentitySecretswithdryRun: true, thendryRun: false.currentEncryptionKeyId,rowsFailed: 0, and identity/sign RPCs still work.Type of Change
Related Issues (Optional)
#847
Breaking Changes
Testing
Additional Notes
#261 Epic