Skip to content

docs: KMS emergency key rotation protocol design - #1516

Merged
1 commit merged into
nextfrom
docs/kms-emergency-key-rotation
Nov 11, 2026
Merged

1 commit merged into
nextfrom
docs/kms-emergency-key-rotation

Conversation

@kvinwang

@kvinwang kvinwang commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Design draft for recovering from a KMS root-key compromise. Not implemented; this is for design review.

Key points:

  • Fleet-wide maintenance window; all CVMs and gateways upgrade and restart together.
  • Per-epoch roots registered on DstackKms; every KMS keeps the full key history.
  • GetAppKey stays at api_version = 1 and gains an epoch selector (absent = epoch 0, or latest); historical epochs are served only until migration_until.
  • Disks rotate the LUKS2 keyslot (luksChangeKey) and record the epoch in a token; the volume key is unchanged.
  • Env is re-encrypted inside the CVM, and the platform swaps the ciphertext via compare-and-swap.
  • KMS onboarding supports ordinary full-history join and rotation join; new epochs are proven by attestation and registered on chain.
  • Gateways restart from clean state and all CVMs re-register.

Describe recovery from KMS root-key exposure using a fleet-wide
maintenance window: per-epoch roots registered on DstackKms, a single
GetAppKey epoch selector (absent = epoch 0, -1 = latest), LUKS2 keyslot
rotation with an epoch token, in-CVM env re-encryption, full-history KMS
onboarding with a rotation mode, and a clean gateway reset.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the docs/kms-emergency-key-rotation branch from a2ab826 to 4b05277 Compare November 8, 2026 09:21
@kvinwang kvinwang closed this pull request by merging all changes into next in 7a83895 Nov 11, 2026
@kvinwang
kvinwang deleted the docs/kms-emergency-key-rotation branch November 11, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant