Skip to content

docs(spec): harden the release and dependency supply chain - #30

Draft
antstanley wants to merge 2 commits into
mainfrom
spec/harden-release-supply-chain
Draft

docs(spec): harden the release and dependency supply chain#30
antstanley wants to merge 2 commits into
mainfrom
spec/harden-release-supply-chain

Conversation

@antstanley

@antstanley antstanley commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Note

Stacked PR 14 of 16 — part of stack #35, which targets main.
Base: #31 (spec/eliminate-secret-leakage-logs-spans) · Followed by: #34

This PR's diff shows only its own change. Merge the stack bottom-up; do not merge this before its base.

Why it sits at position 14: Distribution and CI surfaces. Mutually scoped with #25 on the installer: #25 owns the checksum fail-open, this owns the --version traversal, signing and attestation.

Scope of this PR

This PR currently carries the change spec. It will also carry the implementation plan and the build work for that spec — plan and code land as later commits on this same branch, so the spec, its plan, and its implementation review and merge as one unit.

Review order within the PR: spec first, then plan, then implementation.


Change spec proposing hardening of the release and dependency supply chain.

Problem. Eleven confirmed findings across four surfaces: the publish-npm job resolves dependencies at run time while holding id-token: write publishing rights; release.yml carries one workflow-level permissions block instead of per-job least privilege; release installs bypass the committed lockfile; two of four distribution channels ship with no build provenance; there is no dependency-advisory gate, so a lockfile that fails an advisory check today surfaces nothing; and install.sh interpolates its --version operand into a download URL without validation.

Proposed delta.

  • Per-job least-privilege permissions: blocks, with publint/attw moved out of the publishing job into a permissions: {} validation job.
  • Pin every run-time dependency resolution inside the publish job.
  • --frozen-lockfile on every release install, after regenerating the stale Node lockfile.
  • actions/attest-build-provenance on the binary and container builds — the two channels lacking what npm --provenance and PyPI Trusted Publishing already give the other two — with install.sh verifying via gh attestation verify and failing loudly rather than silently.
  • Pattern-validate the installer's --version operand before any URL is constructed.
  • Separately shippable: a cargo deny advisory gate backed by a new deny.toml, with a stated policy — no entry fails the build; an entry carrying a reachability rationale and an expiry warns until that expiry — plus a resolved-graph dependency-policy check for the pre-release crypto crates.

Corrections to the scan, from reading the workflows and manifests.

  • There are four unpinned package fetches in publish-npm (npm@latest, @napi-rs/cli, npx --yes publint, npx --yes @arethetypeswrong/cli), not five. The fifth cited site is an unfrozen install of the Lambda dependency graph — a different defect, also fixed here.
  • There are two pyo3 advisories, not one: RUSTSEC-2025-0020 (fixed in 0.24.1) and RUSTSEC-2026-0177 (fixed in 0.29.0). bindings/python/Cargo.toml:12 pins "0.22", so no cargo update can reach either fix — this needs a version bump, not a refresh.
  • Two scan findings contradict each other on rsa 0.10.0-rc.18. g4-no-dependency-advisory-gate-in-ci describes it as a dev-only edge that does not ship; crates/adapters/Cargo.toml:19 declares it under [dependencies] (and separately at :40 under [dev-dependencies]), so it does ship. The spec follows the code. This does not make RUSTSEC-2023-0071 reachable — all four RsaPrivateKey::new sites remain #[cfg(test)] — but the crate is in the shipped graph, not only the test graph.
  • --no-frozen-lockfile is release-only. ci.yml uses plain pnpm install, which pnpm freezes automatically under CI.
  • Anchor drift resolved in favour of the code: rsa 0.10.0-rc.18 starts at Cargo.lock:3714; verify_rsa_pkcs1v15 at kms/mod.rs:269; setup.sh key generation at :9-16.

Cross-reference note. The installer's checksum verification failing open is owned by 2026-08-05-fail_closed_across_config_and_adapters.md (#25) and is cross-referenced rather than restated. That file is not on main yet, so the two links resolve once #25 merges.

Drafted with the spec-creator plugin from a deep security scan of the repository at 53cbdec9. Spec only — no source, workflow, or .gitignore changes.

@antstanley
antstanley force-pushed the spec/harden-release-supply-chain branch 2 times, most recently from f2a7343 to 9e9ca4b Compare August 5, 2026 08:22
@antstanley
antstanley changed the base branch from main to spec/eliminate-secret-leakage-logs-spans August 5, 2026 08:22
@antstanley
antstanley marked this pull request as draft August 5, 2026 08:25
@antstanley
antstanley force-pushed the spec/harden-release-supply-chain branch from 9e9ca4b to e744d3b Compare August 5, 2026 09:00
@antstanley
antstanley force-pushed the spec/eliminate-secret-leakage-logs-spans branch from 39283a4 to c398ab3 Compare August 5, 2026 09:00
@antstanley
antstanley force-pushed the spec/harden-release-supply-chain branch from e744d3b to c6d5c2b Compare August 5, 2026 11:29
@antstanley
antstanley force-pushed the spec/eliminate-secret-leakage-logs-spans branch from c398ab3 to 7814df6 Compare August 5, 2026 11:29
@antstanley
antstanley force-pushed the spec/harden-release-supply-chain branch from c6d5c2b to e3cda33 Compare August 5, 2026 12:01
@antstanley
antstanley force-pushed the spec/eliminate-secret-leakage-logs-spans branch from 7814df6 to a308cc3 Compare August 5, 2026 12:01
@antstanley
antstanley force-pushed the spec/eliminate-secret-leakage-logs-spans branch from a308cc3 to 563e998 Compare August 15, 2026 21:39
@antstanley
antstanley force-pushed the spec/harden-release-supply-chain branch from e3cda33 to 5ba2c80 Compare August 15, 2026 21:39
@antstanley
antstanley changed the base branch from spec/eliminate-secret-leakage-logs-spans to main August 15, 2026 21:40
antstanley and others added 2 commits August 16, 2026 19:16
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
@antstanley
antstanley force-pushed the spec/harden-release-supply-chain branch from db87a10 to ef313b6 Compare August 16, 2026 17:16
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