Skip to content

fix(dstackup): render the KMS 0.6 listener layout and default to KMS 0.6.7 - #1709

Open
PierreLeGuen wants to merge 1 commit into
Dstack-TEE:nextfrom
nearai:fix/dstackup-kms-06-config
Open

PierreLeGuen wants to merge 1 commit into
Dstack-TEE:nextfrom
nearai:fix/dstackup-kms-06-config

Conversation

@PierreLeGuen

Copy link
Copy Markdown
Contributor

Summary

Updates dstackup's generated kms.toml and DEFAULT_KMS_IMAGE to the KMS 0.6 layout so single-node SEV-SNP installs get a KMS image that supports SEV-SNP and stores its keyring on the persistent kms-volume.

Changes

  • Render [listeners.default.tls], [listeners.guest], [listeners.admin], and [listeners.onboard] instead of the removed pre-0.6 [rpc] / [core.admin] / core.onboard.{address,port} locations (dstack/crates/dstack-cli-core/src/config.rs).
  • Set core.keyring_dir = "/kms/keyring" so root keys persist on kms-volume instead of /var/lib/kms/keyring.
  • Bump DEFAULT_KMS_IMAGE to digest-pinned ghcr.io/dstack-tee/dstack-kms:0.6.7.

Note on auth-allowlist.json root epochs

As noted in docs/onboarding.md#upgrading-the-local-kms-to-root-epochs (and flagged by Codex review on #1703), KMS 0.6.x authorizes application key release through /authorizeApp, which requires kmsContractAddr and epoch-0 rootEpochs in auth-allowlist.json. This change is split into its own PR so the other fixes can be reviewed and merged independently — happy to follow up with post-bootstrap attested root-epoch registration (or keep 0.5.11 as default and select the kms.toml layout per version) based on your preference.

Verification

  • cargo test --locked -p dstack-cli-core -p dstackup: 18 + 31 passed.
  • cargo clippy --locked -p dstack-cli-core -p dstackup -- -D warnings --allow unused_variables and cargo fmt --all -- --check: pass.

Split out from #1703.

dstackup wrote kms.toml with the listener settings at their pre-0.6
locations ([rpc], [core.admin], core.onboard.address/port), omitted
core.keyring_dir (which defaults to /var/lib/kms/keyring outside the
persistent /kms volume mount), and deployed KMS 0.5.11 by default. The
0.6 KMS refuses the old listener layout at startup ("the config sets
listener settings at their old locations"), and 0.5.11 has no SEV-SNP
support, so a dstackup install on an SNP host never gets a working KMS.

Render [listeners.default.tls], [listeners.guest], [listeners.admin] and
[listeners.onboard], put the keyring on the persistent KMS volume
(/kms/keyring), and default to the 0.6.7 KMS image, which reads that layout.

Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T13:27:27.254343Z 99b5ff3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99b5ff3bd2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// compose hash.
pub const DEFAULT_KMS_IMAGE: &str = "dstacktee/dstack-kms:0.5.11@sha256:84b793feed825a5b5e70d04386e931e0e110461492793f17ab2128e39808d989";
/// compose hash. It has to read the `[listeners.*]` layout `kms_toml` renders.
pub const DEFAULT_KMS_IMAGE: &str = "ghcr.io/dstack-tee/dstack-kms:0.6.7@sha256:693b7c80bad6f759a17f3cc62503eb1ef768852527d448dcfbbb9edb3e8f99f3";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Register bootstrap roots before upgrading the default KMS

On a fresh default dstackup install, auth_allowlist_json() still writes neither kmsContractAddr nor rootEpochs, and the installer never registers them after bootstrap. KMS 0.6.7 sends application key requests to /authorizeApp, whose authorization predicate in dstack/crates/dstack-auth/src/main.rs:435-455 rejects this policy as root epoch not registered. Consequently, the normal dstack deploy flow cannot obtain application disk keys even after registering the compose hash. Register the verified bootstrap identity and epoch-zero CA/k256 keys before switching the default, or retain a compatible older image/config until that flow exists.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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