Skip to content

fix(kms): preserve CA certificates across restart - #952

Merged
kvinwang merged 1 commit into
masterfrom
codex/fix-kms-ca-restart
Aug 5, 2026
Merged

fix(kms): preserve CA certificates across restart#952
kvinwang merged 1 commit into
masterfrom
codex/fix-kms-ca-restart

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Problem

KMS regenerated its CA certificates on every restart even though the persisted private keys were reused. Clients then saw new CA certificates after each restart, making the advertised trust anchors unstable.

Fix

  • Keep the persisted root and temporary CA certificates unchanged during normal startup.
  • Renew either CA certificate with the same private key when it has one year or less remaining.
  • Continue reissuing the RPC leaf certificate on every startup because it carries the current domain and platform attestation.

New CA certificates retain the existing ten-year default lifetime, so renewal extends their expiry by approximately another ten years without rotating the CA keys.

Scope

  • dstack/kms/src/onboard_service.rs
  • One focused commit rebased onto master

Verification

  • cargo fmt --check --all
  • cargo check -p dstack-kms
  • cargo test -p dstack-kms ca_certificate_is_renewed_only_within_the_renewal_window
  • git diff --check origin/master...HEAD

Copilot AI review requested due to automatic review settings July 31, 2026 03:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch from 498224f to 6eded6d Compare August 3, 2026 14:53
@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch from 6eded6d to 9a21c75 Compare August 3, 2026 16:39
@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch from 9a21c75 to 7a8d525 Compare August 3, 2026 16:57
@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch from 7a8d525 to 9a0b2df Compare August 4, 2026 02:26
Base automatically changed from codex/fix-kms-repeated-onboarding to master August 5, 2026 05:04
@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch from 9a0b2df to 68084a3 Compare August 5, 2026 14:43
@kvinwang kvinwang changed the title [STACKED on #930] fix(kms): preserve CA certificates across restart fix(kms): preserve CA certificates across restart Aug 5, 2026
@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch 2 times, most recently from 1a767a8 to 0a8ae83 Compare August 5, 2026 15:07
@kvinwang
kvinwang force-pushed the codex/fix-kms-ca-restart branch from 0a8ae83 to 17650d3 Compare August 5, 2026 15:12
@kvinwang
kvinwang merged commit 8dfbdb0 into master Aug 5, 2026
15 checks passed
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.

2 participants