You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/auth-simple-operations.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The config is re-read on each request, so changes take effect immediately withou
36
36
}
37
37
```
38
38
39
-
> **Note:**Only `osImages` is required. Add `gatewayAppId` after deploying the Gateway. Add `apps` entries as you deploy applications.
39
+
> **Note:**`osImages` is always required. For KMS authorization, you must also populate `kms.mrAggregated`; if it is left empty, auth-simple denies all KMS boots. Add `gatewayAppId` after deploying the Gateway. Add `apps` entries as you deploy applications.
40
40
41
41
---
42
42
@@ -240,7 +240,7 @@ The `mrAggregated` is sent by the booting KMS in its auth request. To get this v
2.**Initial setup**: Leave `kms.mrAggregated` empty for the first KMS (empty array allows any). After it boots, check the logs and add the value.
243
+
2.**Initial setup**: capture the first KMS measurement with `Onboard.GetAttestationInfo` or from auth logs, then add it to `kms.mrAggregated` before bootstrap. An empty array now denies all KMS boots.
Copy file name to clipboardExpand all lines: docs/deployment.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,13 +98,16 @@ Start in separate terminals:
98
98
For production, deploy KMS and Gateway as CVMs with hardware-rooted security. Production deployments require:
99
99
- KMS running in a CVM (not on the host)
100
100
- Auth server for authorization (webhook mode)
101
+
- KMS measurements allowlisted before bootstrap / onboarding / trusted RPCs can succeed
102
+
103
+
If you skip the KMS allowlist step, the VM may boot and the onboard UI may still appear, but the KMS will reject bootstrap, onboarding, or later trusted RPCs with authorization errors.
101
104
102
105
### Production Checklist
103
106
104
107
**Required:**
105
108
106
109
1. Set up TDX host with dstack-vmm
107
-
2. Deploy KMS as CVM (with auth server)
110
+
2. Deploy KMS as CVM (with auth server, capture its attestation info, and allowlist the KMS `mrAggregated` before bootstrap)
108
111
3. Deploy Gateway as CVM
109
112
110
113
**Optional Add-ons:**
@@ -197,11 +200,16 @@ Create `auth-config.json` for initial KMS deployment:
197
200
```json
198
201
{
199
202
"osImages": ["0x<os-image-hash>"],
200
-
"kms": { "allowAnyDevice": true },
203
+
"kms": {
204
+
"mrAggregated": ["0x<kms-mr-aggregated>"],
205
+
"allowAnyDevice": true
206
+
},
201
207
"apps": {}
202
208
}
203
209
```
204
210
211
+
> **Important:**`auth-simple` now treats an empty `kms.mrAggregated` allowlist as deny-all for KMS. Capture the current KMS measurement with `Onboard.GetAttestationInfo` and add it before bootstrap.
212
+
205
213
Run auth-simple:
206
214
207
215
```bash
@@ -460,7 +468,6 @@ Additional KMS instances can onboard from an existing KMS to share the same root
# Restart KMS - it will now serve as a full KMS with shared keys
481
488
```
482
489
483
-
> **Note:** For KMS onboarding with `quote_enabled = true`, add the KMS mrAggregated hash to your auth server's `kms.mrAggregated` whitelist.
490
+
> **Note:** KMS onboarding requires attested KMS instances, and both sides must already be authorized. Add the relevant KMS `mrAggregated` hashes to your auth backend first:
491
+
>
492
+
> - the destination KMS must allow the source KMS
493
+
> - the source KMS must allow the destination KMS
494
+
>
495
+
> If you skip this, `Onboard.Onboard` or later trusted RPCs will fail with KMS authorization errors.
Copy file name to clipboardExpand all lines: docs/tutorials/kms-cvm-deployment.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,6 @@ configs:
188
188
[core.onboard]
189
189
enabled = true
190
190
auto_bootstrap_domain = ""
191
-
quote_enabled = true
192
191
address = "0.0.0.0"
193
192
port = 9100
194
193
EOF
@@ -314,20 +313,49 @@ Onboarding
314
313
```
315
314
316
315
> **Important:** KMS is now in onboard mode — a plain HTTP server waiting for bootstrap. It will **not** serve TLS or respond to `KMS.GetMeta` until you complete the next step.
316
+
>
317
+
> **Critical prerequisite:** before bootstrap can succeed, the KMS must already be authorized by your auth backend.
318
+
>
319
+
> - For `auth-simple`, add the KMS `mrAggregated` to `kms.mrAggregated`
320
+
> - For `auth-eth`, add the KMS `mrAggregated` on-chain with `addKmsAggregatedMr(...)`
> If you skip this step, `Onboard.Bootstrap` will fail with a KMS authorization error and the KMS will not enter normal service.
332
+
>
333
+
>**Pre-bootstrap checklist:**
334
+
>
335
+
> 1. `Onboard.GetAttestationInfo` returns the current KMS measurement
336
+
> 2. that `mrAggregated` has been allowlisted in your auth backend
337
+
> 3. the auth backend is reachable from the KMS CVM
338
+
> 4. you are still calling the onboard HTTP endpoint, not the post-bootstrap TLS endpoint
317
339
318
340
### Step 6: Bootstrap KMS
319
341
320
342
With KMS in onboard mode, trigger key generation by calling the Bootstrap RPC endpoint. This generates root keys, a TDX attestation quote, and writes `bootstrap-info.json`:
# Replace kms.yourdomain.com with your actual KMS domain
324
352
curl -s -X POST \
325
353
-H "Content-Type: application/json" \
326
354
-d '{"domain":"kms.yourdomain.com"}' \
327
355
"http://localhost:9100/prpc/Onboard.Bootstrap?json"| tee ~/kms-deploy/bootstrap-info.json | jq .
328
356
```
329
357
330
-
> **Note:** This uses plain `http://` — KMS is still in onboard mode (no TLS yet). The `tee` command saves the response to `bootstrap-info.json` while also displaying it. You'll need this file later to register KMS on-chain.
358
+
> **Note:** This uses plain `http://` — KMS is still in onboard mode (no TLS yet). The `tee` command saves the response to `bootstrap-info.json` while also displaying it. You'll need this file later to register KMS on-chain. If this call fails with a KMS authorization error, allowlist the `mrAggregated` value first and retry.
2.**SGX Auto MP Registration not enabled** - Without this BIOS setting, your platform isn't registered with Intel's PCS, and attestation quotes cannot be verified. Re-enter BIOS and enable "SGX Auto MP Registration".
261
261
262
-
3.**quote_enabled is false** - Verify your `kms.toml` has `quote_enabled = true` in the `[core.onboard]` section.
263
-
264
-
4.**Guest-agent not running** - The `/var/run/dstack.sock` socket must exist inside the CVM.
262
+
3.**Guest-agent / simulator not running** - The KMS must be able to reach a working dstack guest agent endpoint. In a real CVM, `/var/run/dstack.sock` must exist. For local development, start `sdk/simulator` first.
0 commit comments