Skip to content

feat(deploy): pin OK-170 release digests by platform child, with G0 package builder and rehearsal driver (OK-170) - #187

Merged
stks01 merged 69 commits into
mainfrom
feat/ok-170-digest-pin
Dec 3, 2026
Merged

stks01 merged 69 commits into
mainfrom
feat/ok-170-digest-pin

Conversation

@stks01

@stks01 stks01 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Why

OK-170 approval c15449 (B5) calls for one digest-pin PR before the disposable rehearsal. Arash's signed tags are published and verified. This PR pins them, together with the offline G0 package builder and the rehearsal driver that the rehearsal runs.

Released images

Role Tag Source Index linux/amd64 (deployed) linux/arm64
C1 Console dev-breakglass-v0.1.0-rc.32 ok-console 928a2f1 7246deca…5ac2 b6f851f3…d755 0aef3d84…3699
C1-R Console recovery dev-v0.1.0-rc.21 ok-console 928a2f1 9d4cd302…51bc 5309e1e9…9e3a adc02590…7250
P1 producer console-observer-dev-v0.1.0-rc.22 openkubes fe9d8c3 dd2d3b19…b1c3 de83ba15…0c0c 622100bd…edb5

Each image was verified for tag→digest, the platform map, Trivy (amd64 and arm64), the cosign signature at the tag identity, SLSA v1 and SPDX 2.3 attestations, and labels (revision, auth/data mode). The full digests are in deploy/kubernetes/overlays/expected-digests.json and the procedure's candidate table.

Candidate source change. The Console candidate moved from 4dd41e7 to 928a2f1 (#186, libzstd1 CVE-2026-124851 runtime-base re-pin). Its rc.31/rc.20 builds of 4dd41e7 failed the vulnerability gate and are rejected.

Change

  • Deploy form: the linux/amd64 platform-child digest. The record keeps the index as the signed, attested identity. The overlays and the G0 builder deploy C1, C1-R and P1 by their amd64 child. containerd 2.0.3 reports the pulled reference as the imageID, so pinning the child is what lets the procedure's Q2 check ("approved platform-child digest") hold. The procedure's "(pinned index digest)" wording is aligned to this.
    • The recovery guards accept exactly <repo>@<platforms["linux/amd64"]> for a released entry, and reject the index, the arm64 child, any other digest and the sentinel.
    • ok-shared-live is unchanged: C0/P0 stay the live and rollback pair, and only they may use the recorded index form.
    • There is no admission signature policy in any repo, so signatures are verified before deploy (Q9).
  • Recovery records released. The bootstrap sentinel is replaced by C1-R and the breakglass rc.3 entry by C1. Both records carry provenance, and both overlays pin the amd64 child.
  • Rejected identifiers. These are refused everywhere: the indexes, both children, tags and revisions of ok-console rc.30/rc.31/rc.20 and producer rc.21. That covers the builder, the recovery render, verify-recovery-image.sh (both modes) and the repo scan. Tags match whole, so rc.20 never blocks rc.200.
  • verify-recovery-image.sh registry bootstrap|breakglass <ref>. The role is explicit. The reference must equal that role's record index. The script checks the exact platform map, labels and the publish-dev-image attestation for the tag, and prints the verified role.
  • G0 package builder and rehearsal driver. These are the offline package builder and the disposable-cluster rehearsal driver: seed, expectations, binding, checks, session, phases, run and cleanup. The pre-H admission set follows procedure L179 unchanged.
  • Docs. The maintenance procedure's candidate table and release section, the acceptance-plan candidate rows, and the overlay READMEs.

Verification

On the PR head:

  • pnpm lint 0.
  • vitest run deploy/kubernetes (--maxWorkers=1 --testTimeout=15000): 1956/1956 passed.
  • test:rehearsal-session: 111/111.
  • Guard-removal campaign: 393 mutants, all caught. Every // guard: site is removed once and its case fails.
  • render-ok-shared-recovery.mjs renders …@5309e1e9… (bootstrap) and …@b6f851f3… (post-recovery).
  • verify-recovery-image.sh local 928a2f1…: PASS.

Registry, anonymous GHCR:

Command Result
registry bootstrap <C1-R> PASS, role=bootstrap, rc.21
registry breakglass <C1> PASS, role=breakglass, rc.32
registry bootstrap <C1> FAIL
registry breakglass <C1-R> FAIL
registry bootstrap <C1> against a staged fake bootstrap record FAIL

Scope of this evidence

  • Applies to: offline behaviour of the builder, guards and rehearsal driver, plus the registry identity of C1 and C1-R at these digests.
  • Shown in: this PR's checks. The live deploy form (child imageID on containerd 2.0.3) and the full G0/G1/G2 sequence are shown by the disposable rehearsal that follows this PR.
  • Follow-ups:
    • P1's child-to-index binding is checked by Q9 at run time, not by a repo tool.
    • Offline checks validate a record's shape, not which build it is; registry mode does that.
    • The vitest run reports one known Timeout calling onTaskUpdate worker error while every test passes.
    • Known rehearsal-driver limitations:
      • Unowned server-default drift passes final values.
      • The post-H inputs are only builder-checked.
      • The rendered recovery (RB) is first exercised live in the rehearsal.
      • Kubectl failures are classified from stderr only.

stks01 and others added 30 commits November 26, 2026 13:07
…forbidden-server fixes, independent deviation proof
…-only scan needles, check-target --post-setup, hash after passing check
…e and field credential needles, exact r2 differential, trimmed nonces
…expectations

# Conflicts:
#	deploy/kubernetes/fixtures/ok170-rehearsal/guards.mjs
#	deploy/kubernetes/fixtures/ok170-rehearsal/mutate.mjs
…ectl cannot open /dev/stdin under spawnSync)
…eouts, default-runner coverage, nonce isolation
…, managedFields reads, final-value check, failed-step record
…expectations

# Conflicts:
#	deploy/kubernetes/fixtures/ok170-rehearsal/guards.mjs
#	deploy/kubernetes/fixtures/ok170-rehearsal/mutate.mjs
#	deploy/kubernetes/rehearse-ok170/seed.mjs
… set, scratch label, settle waits, procedure-only H
…der (sorted fieldsV1 keys made SSA reorder env)
…tory; server-only paths must be unowned; Namespace covered
…tus attribution, STOP latch, artifact path checks, split guards
…ks, Q9

- oracle binds every applied/admitted artifact (package + sha256) into expectations/package-bindings.json
- binding.mjs: recompute bindings from the final packages before P0; live-run checks 1-10 as functions;
  prepareRun (check-target, Q9, seed rc 0 only, builds, oracle x2, identity checks, binding)
- q9.mjs: index/child digests, cosign identity, SLSA + SPDX attestations, source revision, frozen run URLs
- config: optional frozenRunUrls {C1, C1R, P1}
- common.mjs: shared helpers for new modules
…certificate run identity

Review r1 (REVISE) findings:
- B1 P0 binds and evaluates HANDOVER_UNDO_ARTIFACT (G0 undo dry-run, procedure L187)
- B2 expectations.mjs bindingPlan/phasePackage shared by oracle and verifier; verifier requires the planned package
- B3 Q9 requires the Fulcio certificate runInvocationURI/sourceRepositoryDigest/sourceRepositoryRef and the SLSA
  predicate to name the same run as the frozen URL
- package directories and per-package inventories must match across all five packages
- release JSON shape guard; coverage refusals name the artifact; stale-binding pipeline test
- guard-removal harness separates true kills from fail-closed crashes (listed)
…y entries, true-kill cases

Review r2 (REVISE):
- oracle P0 undo dry-run as ok-173-breakglass must be warning-free, on the snapshot UID and resourceVersion, with
  zero value delta and an unchanged breakglass v1 Apply field set (procedure L190); else STOP before H
- package directories compare every entry (empty or stray entries refuse)
- binding-sums-line and common-tree-root cases now pass without their guard (duplicate row, symlinked tree)
…rget check, package root

Review r3 (REVISE):
- assertUndoDryRun: UID and resourceVersion must be present (absent on both sides no longer equal); breakglass
  fieldsV1 must be present
- the undo artifact gets the same target check as every admission, before its dry-run
- package roots must be real directories (a symlinked packages/ root refuses)
Harness: mutate.mjs copies common.mjs into mutants; two stale variant sites (server-real-handover,
server-pu-artifact) follow the r1/r2 oracle code.
- config, target, packages, seed, expectations, expectations-server and procedure use common.mjs stop, isRecord,
  sha256, prettyJson and refuseSymlinkAncestors; config.mjs and packages.mjs re-export stop and sha256
- behaviour unchanged: guard ids identical per file, STOP texts, exit classes, modes and write flags preserved
- test: every mutation variant site must occur exactly once in its file
- cases for the three previously surviving mutations (seed projection roots/metadata, server default base) and the
  writer ancestor check; full guard-removal campaign 245 killed, 0 survived
…etween checkpoints, session wiring

- checks.mjs: Q1 verbatim, pinned-CA health 204, mixed/bootstrap expected-images writer with both Deployment
  keys, Q3 admission against hash-checked post-apply expectations
- session.mjs: PID-owned port-forward per Ready Console replica, session-runner client; inconclusive never passes
- procedure.mjs: STOP latch by boolean; foreign caller-check errors wrapped as phase STOPs (M5a follow-up 3)
… Q3 inputs, latch hook

Review r1 (red-team + pr-reviewer):
- runtime identity: the approved pair comes from the phase and bound recovery artifacts, never the caller's roles
- Q3: package records, manifests and overlay pinned after prepareRun; checkpoint expected-images compared with the
  release; verifier requires VERIFY_READONLY=PASS
- Q1 judged from the procedure step's own stdout
- session evidence scans credential values and filenames; runner shutdown waits for queued cleanup and reports
  leftovers; checks and sessions latch through a procedure hook; one exported ProcedureStop helper
- exit class before/after an apply attempt documented and tested (2 / 1)
…overlay render, latch on any check error

Review r2 (pr-reviewer + red-team):
- external STOPs exit 2 before any apply attempt, 1 after
- Q3 verifier reads a private overlay built from the render pinned at createChecks
- any error inside an observed check latches, wrapped without raw error text
- mixed phases require the applied artifact; exact-pair cases for every phase->roles entry; latch hook required
- session close always checks leftovers; bounded wait after SIGKILL; prepareRun digests verified by createChecks
…st, exit class by apply attempt only

Review r3 (red-team):
- Q3 overlay render uses targetEnvironment (KUBECTL_KUBERC=false, no other KUBECTL_*) and must equal the oracle's
  render digest (expectations/overlay-render.json, checksummed); drift STOPs with exit 2
- exit class depends only on whether an apply was attempted (2 before, 1 after); inline and observed checks agree
- a latch hook returning a non-Error no longer throws a raw value
…ared Recovery E verification, retained evidence pinned
…t credential basenames, rollout vs read split
…tl rollout timeout inside budget, live old-context check
…leased recovery records, rejected rc.31/rc.20
…ren in recovery tools, breakglass registry verify
@stks01
stks01 merged commit 5d36863 into main Dec 3, 2026
2 checks passed
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