From d9dc250c7c099ead07e8b558c406ad65298da6a2 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sun, 15 Nov 2026 18:24:27 -0800 Subject: [PATCH] vmm-cli: allow overriding KMS whitelist path via env Add DSTACK_VMM_KMS_WHITELIST_PATH so callers (e.g. test harnesses) can isolate trusted KMS signer pins without changing HOME. Signed-off-by: Kevin Wang --- docs/vmm-cli-user-guide.md | 2 +- dstack/vmm/src/vmm-cli.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/vmm-cli-user-guide.md b/docs/vmm-cli-user-guide.md index 4078de095..5e6a7391f 100644 --- a/docs/vmm-cli-user-guide.md +++ b/docs/vmm-cli-user-guide.md @@ -550,7 +550,7 @@ Manage trusted KMS public keys for enhanced security: ./vmm-cli.py kms remove 0x1234567890abcdef... ``` -The whitelist is stored in `~/.dstack-vmm/kms-whitelist.json`. +The whitelist is stored in `~/.dstack-vmm/kms-whitelist.json`; set `DSTACK_VMM_KMS_WHITELIST_PATH` to use a different file. After a KMS root rotation, first remove the old signer with `kms remove`, then add the new one with `kms add`. The whitelist is a flat set and the CLI cannot diff --git a/dstack/vmm/src/vmm-cli.py b/dstack/vmm/src/vmm-cli.py index db36306f7..cf5ac668f 100755 --- a/dstack/vmm/src/vmm-cli.py +++ b/dstack/vmm/src/vmm-cli.py @@ -35,7 +35,10 @@ # Default config file locations DEFAULT_CONFIG_PATH = os.path.expanduser("~/.dstack-vmm/config.json") -DEFAULT_KMS_WHITELIST_PATH = os.path.expanduser("~/.dstack-vmm/kms-whitelist.json") +DEFAULT_KMS_WHITELIST_PATH = os.environ.get( + "DSTACK_VMM_KMS_WHITELIST_PATH", + os.path.expanduser("~/.dstack-vmm/kms-whitelist.json"), +) # VMM discovery directories