Sign runner-start statements for each sandbox #22

Open
opened 2026-10-21 03:26:03 +00:00 by lex00 · 0 comments
Collaborator

(needs INTENTIUS/terragucci#1154 and a terragucci that pins chant 0.124.33 or later; after #21. chant#4147 shipped in chant 0.124.33, PR #4173.)
Part of the terraform-plane epic (arugula-salad/arugula#1141). Lands after terragucci's next release, the first built on chant 0.124.41 or later (chant#4287); npm's newest is still 0.4.40, on chant 0.124.24.

terragucci is adding runner.apply.require: ephemeral (INTENTIUS/terragucci#1154): an apply job refuses to run, before it trades for any credentials, unless the runner proves it was started for that one job. The proof is chant's runner-start/v1 statement (INTENTIUS/chant#4147): signed by the provisioner that started the runner, with a key the job never holds, naming the CI system, the job, run and attempt ids, the repo and the commit, and verified against a runners key in .chant/trust.json.

sluice already starts a fresh loam sandbox for every stage and destroys it after, so it is that provisioner. Without a statement, an estate that turns the setting on can't apply under sluice at all.

chant 0.124.33 settled both open questions (packages/core/src/runner-start.ts):

  • The statement is an in-toto Statement v1 in a DSSE envelope, Ed25519, predicate type https://intentius.io/chant/runner-start/v1, subject the commit (digest.gitCommit), predicate {signer, ci:{system, repo, run, attempt, job}, runner:{name?, singleJob:true}, issuedAt}, parsed strictly. No age limit by default.
  • ci.system is github | gitlab | forgejo only, so sluice signs as github (a Forgejo estate as forgejo) with its shim's ids. ciJobFromEnv requires GITHUB_ACTIONS=true, GITHUB_REPOSITORY, GITHUB_RUN_ID, GITHUB_JOB, GITHUB_SHA and RUNNER_NAME, and reads GITHUB_RUN_ATTEMPT (default 1). Non-numeric run ids are accepted. sluice's stageEnv sets none of GITHUB_ACTIONS, GITHUB_JOB, RUNNER_NAME or GITHUB_RUN_ATTEMPT, so it adds them (job = the stage and wave, runner = the sandbox id).
  • GITHUB_ACTIONS=true makes terragucci print ::add-mask::<value> lines (secret-values.ts:59), so sluice's run log must redact them.
  • Verify reads CHANT_RUNNER_START (the envelope as JSON), else the file named by CHANT_RUNNER_START_FILE, else /run/chant/runner-start.json.
  • Signing: chant ci runner-start sign --key <pem> --principal <p> --job <json>, or signRunnerStart from the bundle-safe @intentius/chant/runner-start.
  • Trust: the key is listed under runners in .chant/trust.json at base, and its principal holds roles.runner. chant workspace trust runner add writes the entry (chant#4119). A runner entry the signers file also lists is dropped.

Done when:

  • sluice holds an Ed25519 runner signing key outside the sandbox (not RS256 like the OIDC keys; rotation is a commit to .chant/trust.json on the estate's default branch, not a JWKS update), and signs a runner-start/v1 statement for each stage it starts, naming that run, attempt and commit.
  • The sandbox gets the statement in CHANT_RUNNER_START or a file named by CHANT_RUNNER_START_FILE, the stage env carries the GITHUB_* and RUNNER_NAME fields above, ::add-mask:: lines are redacted from the log, and the key never enters the sandbox.
  • The estate's settings page shows the public key and the .chant/trust.json entry to add, as it shows the OIDC trust snippets (or the chant workspace trust runner add command).
  • An estate with runner.apply.require: ephemeral applies under sluice; a statement for another run or commit is refused; a test covers both.
  • docs/oidc.md (or a new page) says what the statement proves and what it doesn't.

Related: arugula-salad/arugula#1141.

From a review of sluice against chant's in-flight work (2026-10-20). Proposal for the maintainer; PRs would come from lex00/sluice.

Updated 2026-10-22 for terragucci main (pins chant 0.124.41, terragucci#1212–#1223) and chant 0.124.41–0.124.42.

(needs INTENTIUS/terragucci#1154 and a terragucci that pins chant 0.124.33 or later; after #21. chant#4147 shipped in chant 0.124.33, PR #4173.) Part of the terraform-plane epic (arugula-salad/arugula#1141). Lands after terragucci's next release, the first built on chant 0.124.41 or later (chant#4287); npm's newest is still 0.4.40, on chant 0.124.24. terragucci is adding `runner.apply.require: ephemeral` (INTENTIUS/terragucci#1154): an apply job refuses to run, before it trades for any credentials, unless the runner proves it was started for that one job. The proof is chant's `runner-start/v1` statement (INTENTIUS/chant#4147): signed by the provisioner that started the runner, with a key the job never holds, naming the CI system, the job, run and attempt ids, the repo and the commit, and verified against a `runners` key in `.chant/trust.json`. sluice already starts a fresh loam sandbox for every stage and destroys it after, so it is that provisioner. Without a statement, an estate that turns the setting on can't apply under sluice at all. chant 0.124.33 settled both open questions (`packages/core/src/runner-start.ts`): - The statement is an in-toto Statement v1 in a DSSE envelope, Ed25519, predicate type `https://intentius.io/chant/runner-start/v1`, subject the commit (`digest.gitCommit`), predicate `{signer, ci:{system, repo, run, attempt, job}, runner:{name?, singleJob:true}, issuedAt}`, parsed strictly. No age limit by default. - `ci.system` is `github | gitlab | forgejo` only, so sluice signs as `github` (a Forgejo estate as `forgejo`) with its shim's ids. `ciJobFromEnv` requires `GITHUB_ACTIONS=true`, `GITHUB_REPOSITORY`, `GITHUB_RUN_ID`, `GITHUB_JOB`, `GITHUB_SHA` and `RUNNER_NAME`, and reads `GITHUB_RUN_ATTEMPT` (default 1). Non-numeric run ids are accepted. sluice's `stageEnv` sets none of `GITHUB_ACTIONS`, `GITHUB_JOB`, `RUNNER_NAME` or `GITHUB_RUN_ATTEMPT`, so it adds them (job = the stage and wave, runner = the sandbox id). - `GITHUB_ACTIONS=true` makes terragucci print `::add-mask::<value>` lines (`secret-values.ts:59`), so sluice's run log must redact them. - Verify reads `CHANT_RUNNER_START` (the envelope as JSON), else the file named by `CHANT_RUNNER_START_FILE`, else `/run/chant/runner-start.json`. - Signing: `chant ci runner-start sign --key <pem> --principal <p> --job <json>`, or `signRunnerStart` from the bundle-safe `@intentius/chant/runner-start`. - Trust: the key is listed under `runners` in `.chant/trust.json` at base, and its principal holds `roles.runner`. `chant workspace trust runner add` writes the entry (chant#4119). A runner entry the signers file also lists is dropped. Done when: - sluice holds an Ed25519 runner signing key outside the sandbox (not RS256 like the OIDC keys; rotation is a commit to `.chant/trust.json` on the estate's default branch, not a JWKS update), and signs a `runner-start/v1` statement for each stage it starts, naming that run, attempt and commit. - The sandbox gets the statement in `CHANT_RUNNER_START` or a file named by `CHANT_RUNNER_START_FILE`, the stage env carries the `GITHUB_*` and `RUNNER_NAME` fields above, `::add-mask::` lines are redacted from the log, and the key never enters the sandbox. - The estate's settings page shows the public key and the `.chant/trust.json` entry to add, as it shows the OIDC trust snippets (or the `chant workspace trust runner add` command). - An estate with `runner.apply.require: ephemeral` applies under sluice; a statement for another run or commit is refused; a test covers both. - `docs/oidc.md` (or a new page) says what the statement proves and what it doesn't. Related: arugula-salad/arugula#1141. From a review of sluice against chant's in-flight work (2026-10-20). Proposal for the maintainer; PRs would come from lex00/sluice. Updated 2026-10-22 for terragucci main (pins chant 0.124.41, terragucci#1212–#1223) and chant 0.124.41–0.124.42.
Sign in to join this conversation.
No labels
terraform-plane
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jhgaylor/sluice#22
No description provided.