Skip to content

Commit 331c3d0

Browse files
committed
trusted-workload-launcher: precise trust-surface wording
Three precision fixes to avoid overclaiming the simplification: - Default mode: trust-bearing config is REPO_URL + COMMIT_SHA and REPO_SUBDIR when used (it selects which tee-launch.sh runs). Made this explicit in the example README intro, the default-mode section, the VERIFY.md quick-path summary and Mermaid diagram, and step 4 of the deep-path checklist. Clarified that WORK_DIR is local plumbing (not trust-bearing) and that CHILD_ENV_FILE / runtime env can affect runtime behavior but not the bytes that run, so it should be audited as runtime deployment configuration rather than as source. - Advanced mode: corrected the framing so RUN_CMD / INSTALL_CMD are described as "trust-bearing deployment config" rather than "source code at the pinned commit" — they live in the launcher config, not in the upstream repo at COMMIT_SHA, and so are not covered by its source provenance. - VERIFY.md log example: reordered to match what the launcher actually emits (mode line during the config summary, then checking out, then HEAD verified, then exec) and described the lines as ones the output should include, not a strict transcript.
1 parent b0478b6 commit 331c3d0

2 files changed

Lines changed: 54 additions & 32 deletions

File tree

trusted-workload-launcher/README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ By convention, **the workload repo provides its own bash entry point at the
1717
fixed path `tee-launch.sh`** (default mode). This keeps install/build/run
1818
logic inside the workload repo, where it is covered by source provenance of
1919
the pinned `COMMIT_SHA` and is **not** a trust-bearing field in the
20-
launcher config. A verifier therefore only audits two things: the launcher
21-
image's identity, and the `REPO_URL` + `COMMIT_SHA` pair in the attested
22-
config.
20+
launcher config. A verifier therefore audits two things: the launcher
21+
image's identity, and the `REPO_URL` + `COMMIT_SHA` pair (plus
22+
`REPO_SUBDIR` when used, since it selects *which* `tee-launch.sh` runs)
23+
in the attested config.
2324

2425
The launcher image is **generic**: its digest attests the launcher's
2526
implementation, not the workload. The workload identity comes from the
@@ -148,13 +149,21 @@ Recommended for every workload you control. The workload repo provides a
148149
bash script at the fixed path `tee-launch.sh` (at the repo root, or at
149150
`REPO_SUBDIR/tee-launch.sh` if `REPO_SUBDIR` is set). The launcher runs it
150151
with `bash tee-launch.sh` after checkout — **no executable bit is
151-
required**. All install/build/run logic lives in that script; the launcher
152-
config carries only `REPO_URL` + `COMMIT_SHA` (+ local `WORK_DIR`).
153-
154-
Because the script's bytes are pinned by `COMMIT_SHA` and stored in the
155-
workload repo, they are covered by source provenance of the pinned commit.
156-
The verifier does not need to extract or audit any command string out of
157-
the launcher config.
152+
required**. All install/build/run logic lives in that script.
153+
154+
In this mode the trust-bearing config in the launcher's config file is
155+
`REPO_URL` + `COMMIT_SHA` (and `REPO_SUBDIR` if used, since it selects
156+
which `tee-launch.sh` runs). `WORK_DIR` is local plumbing — it names
157+
where on the in-TEE filesystem to keep the checkout — and is not
158+
trust-bearing. `CHILD_ENV_FILE` (and any env it provides) can change the
159+
script's runtime behavior but does not change the bytes that run; if the
160+
deployment uses it, audit it the same way you audit any other runtime
161+
configuration the deployment ships with.
162+
163+
Because `tee-launch.sh`'s bytes are pinned by `COMMIT_SHA` and stored in
164+
the workload repo, they are covered by source provenance of the pinned
165+
commit. The verifier does not need to extract or audit any command string
166+
out of the launcher config.
158167

159168
### Advanced mode: explicit `RUN_CMD` / `INSTALL_CMD`
160169

trusted-workload-launcher/VERIFY.md

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ TEE is the one they audited.
77
## Quick path (default mode, 4 steps)
88

99
In default mode the workload repo provides its own `tee-launch.sh` at the
10-
pinned commit, so the trust-bearing config is just `REPO_URL + COMMIT_SHA`
11-
and the install/run command chain disappears from the verifier's checklist.
10+
pinned commit, so the trust-bearing config is `REPO_URL + COMMIT_SHA`
11+
(plus `REPO_SUBDIR` when used, since it selects which `tee-launch.sh`
12+
runs) and the install/run command chain disappears from the verifier's
13+
checklist. `WORK_DIR` is local plumbing and is not trust-bearing.
1214
The whole chain is:
1315

1416
```mermaid
1517
flowchart LR
16-
A[dstack attestation] --> B[launcher image digest<br/>+ REPO_URL<br/>+ COMMIT_SHA]
18+
A[dstack attestation] --> B[launcher image digest<br/>+ REPO_URL<br/>+ COMMIT_SHA<br/>+ REPO_SUBDIR if used]
1719
B --> C[Sigstore attestation<br/>for launcher image digest<br/>= dstack-examples@ref/SHA]
18-
B --> D[upstream repo at COMMIT_SHA<br/>incl. tee-launch.sh]
20+
B --> D[upstream repo at COMMIT_SHA<br/>incl. tee-launch.sh under REPO_SUBDIR]
1921
```
2022

2123
1. **Verify the dstack attestation.**
2224
`phala cvms attestation --cvm-id <id> --json` and feed the TDX quote
2325
into the dstack verifier (or trust the Phala Cloud verifier as a lite
2426
path). Read out the deployed launcher image digest and the attested
25-
`REPO_URL` + `COMMIT_SHA`.
27+
`REPO_URL` + `COMMIT_SHA` (and `REPO_SUBDIR` if present).
2628
2. **Verify launcher image provenance via Sigstore.** Confirm the image
2729
digest from step 1 carries a build-provenance attestation signed by
2830
the expected `Dstack-TEE/dstack-examples` GitHub Actions workflow at
@@ -40,10 +42,11 @@ upstream commit you audited, produced by an audited launcher.
4042

4143
> **Advanced mode adds one step.** If the launcher config sets `RUN_CMD`
4244
> (and optionally `INSTALL_CMD`) instead of relying on `tee-launch.sh`,
43-
> those strings are trust-bearing config: read them from the attested
44-
> compose in step 1 and audit them as if they were source code at the
45-
> pinned commit. The simplification of the default mode is exactly that
46-
> this extra step does not exist.
45+
> those strings are trust-bearing deployment config: read them from the
46+
> attested compose in step 1 and audit them like any other deployment
47+
> code — they are not part of the upstream repo at `COMMIT_SHA` and so
48+
> are not covered by its source provenance. The simplification of the
49+
> default mode is exactly that this extra step does not exist.
4750
4851
The rest of this document explains how the chain works and what to do at
4952
each step.
@@ -176,39 +179,49 @@ evidence of tampering.
176179
### 4. Extract and audit the workload pin
177180

178181
Parse the `configs:` content from step 2 and read `REPO_URL` and
179-
`COMMIT_SHA` (plus optional `REPO_SUBDIR` / `CHILD_ENV_FILE`). In default
180-
mode there are no `INSTALL_CMD` / `RUN_CMD` strings to audit — the entry
181-
point is the fixed-path `tee-launch.sh` in the workload repo, which is
182-
covered by source provenance of the pinned commit. In advanced mode
183-
(`RUN_CMD` present) also read `RUN_CMD` and any `INSTALL_CMD` and treat
184-
them as trust-bearing config.
182+
`COMMIT_SHA` (plus `REPO_SUBDIR` if present — it selects which
183+
`tee-launch.sh` is used). `WORK_DIR` is local plumbing only and is not
184+
part of the trust-bearing config. `CHILD_ENV_FILE` (and any env it
185+
supplies) does not change the bytes that run; if used, audit it as
186+
runtime deployment configuration, not as source.
187+
188+
In default mode there are no `INSTALL_CMD` / `RUN_CMD` strings to audit —
189+
the entry point is the fixed-path `tee-launch.sh` in the workload repo,
190+
which is covered by source provenance of the pinned commit. In advanced
191+
mode (`RUN_CMD` present), also read `RUN_CMD` and any `INSTALL_CMD` and
192+
audit them as trust-bearing deployment config: they are not part of the
193+
upstream repo at `COMMIT_SHA` and so are not covered by its source
194+
provenance.
185195

186196
```sh
187197
git -C <workload-checkout> rev-parse --verify <COMMIT_SHA>
188198
```
189199

190200
Confirm the upstream repo at `REPO_URL` contains `COMMIT_SHA`, and review
191-
the workload at that commit, including `tee-launch.sh` in default mode.
192-
This is the code that actually serves traffic.
201+
the workload at that commit, including `<REPO_SUBDIR>/tee-launch.sh` in
202+
default mode. This is the code that actually serves traffic.
193203

194204
### 5. Spot-check runtime logs
195205

196206
```sh
197207
phala logs --cvm-id <id> -n 200
198208
```
199209

200-
Default mode expected:
210+
Default-mode output should include these lines (the launcher logs `mode`
211+
during config summary, then the checkout/verify lines, then the `exec`
212+
line, so they appear in this order):
201213

202214
```
215+
[trusted-workload-launcher] mode: default (workload repo tee-launch.sh)
203216
[trusted-workload-launcher] checking out <COMMIT_SHA>
204217
[trusted-workload-launcher] HEAD verified: <COMMIT_SHA>
205-
[trusted-workload-launcher] mode: default (workload repo tee-launch.sh)
206218
[trusted-workload-launcher] exec in <WORK_DIR>[/<REPO_SUBDIR>]: bash tee-launch.sh
207219
```
208220

209-
Advanced mode shows the explicit `RUN_CMD` instead of `bash tee-launch.sh`
210-
on the last line. Either way these lines show the launcher reached the
211-
post-checkout state. They are not signed, so they don't replace
221+
Advanced mode logs `mode: advanced (RUN_CMD)` early on, and the last
222+
`exec in ...:` line shows the explicit `RUN_CMD` instead of
223+
`bash tee-launch.sh`. Either way these lines show the launcher reached
224+
the post-checkout state. They are not signed, so they don't replace
212225
steps 1–4 — they corroborate.
213226

214227
A workload that needs signed runtime evidence should produce its own

0 commit comments

Comments
 (0)