Skip to content

Release attestation, spec-lock evidence, static musl builds, Nix flake - #16

Draft
secsovereign wants to merge 1 commit into
mainfrom
release-attestation-musl-nix
Draft

secsovereign wants to merge 1 commit into
mainfrom
release-attestation-musl-nix

Conversation

@secsovereign

Copy link
Copy Markdown
Member

Each stable release now ships a verification bundle that maintainers rebuild against and sign, and that operators check with one script. Details are in docs/RELEASE_ATTESTATION.md.

What changes in a release

  • Spec-lock evidence (new spec-evidence job, gates release). It reads the blvm-consensus version and checksum from Cargo.lock, checks the downloaded .crate against that checksum, unpacks it, and runs cargo spec-lock verify (strict, Z3, pinned 0.1.45 like blvm-consensus) and check-drift against blvm-spec HEAD. verify failing blocks the release. Drift is recorded, not gating.
  • Attestation and bundle. blvm-<tag>-attestation.json, -build-config.json, and a deterministic -verification-bundle.tar.gz (checksums, spec-lock report and logs, spec file hashes). source_hash, build_config_hash, and spec_hash tie them together, and a maintainer signature covers all three plus the bundle hash.
  • Sigstore provenance now covers every uploaded file. Before, it covered only the three bare binaries.
  • Static musl binaries for x86_64 and aarch64, built with cargo-zigbuild and with home, cargo home, sysroot, repo, and target paths remapped for Rust and C. They run on NixOS and Alpine, and they are what maintainers rebuild. These steps are continue-on-error until the first green run.
  • Version bump moved into scripts/release-bump-version.sh, so a rebuild from the tag embeds the same version string.

Maintainer and operator tools

  • scripts/sign-release.sh, rewritten. The old script signed local artifacts without a rebuild check and was not referenced anywhere. The new one checks provenance and bundle consistency, confirms source_hash and the post-bump Cargo.lock hash, rebuilds both musl binaries, and signs with blvm-sign-binary bundle only if both hashes match.
  • scripts/verify-release.sh checks checksums, provenance, bundle consistency, prints the spec-lock result, and checks the threshold in the local release-keys/policy.json.
  • release-keys/policy.json has no enrolled keys yet, so the threshold is 0 and signatures are reported as not enforced.

Nix

flake.nix builds blvm from source against Cargo.lock with the Linux release feature set and the toolchain from rust-toolchain.toml. nixosModules.blvm runs it as a hardened systemd service.

Tested here

  • spec-lock-evidence.sh against the real blvm-consensus 0.1.81 crate and blvm-spec HEAD. 281 of 281 rows passed, drift clean, and the run took about a minute. That run found that spec-lock skips files under dot-directories such as ~/.cargo, so the script unpacks the checked .crate to /tmp.
  • release-attestation.sh on staged files. Running it twice gives a byte-identical bundle.
  • verify-release.sh with a stubbed gh and real blvm-sign-binary/blvm-verify-binary 0.1.23. 2-of-2 passes. One signature, a signature from an unenrolled key under an enrolled name, a signature over a different spec_hash, a tampered binary, and an edited attestation all fail.
  • shellcheck is clean on the new scripts. actionlint reports no new findings beyond the existing custom builds runner label. The Nix files parse cleanly.

Not tested here

  • The musl builds. This sandbox cannot download Rust std for musl targets, so the first CI run is the first build. Native C deps (aws-lc-sys, jemalloc, lmdb, vendored OpenSSL) under zig cc are the likely failure points.
  • Byte-for-byte reproducibility of the musl builds across machines. sign-release.sh refuses to sign on a mismatch and points at diffoscope.
  • nix build and nix flake check, because Nix isn't available here. Run nix flake lock and commit flake.lock.
  • sign-release.sh end to end, which needs a published tag.

Before merge

  • Pin actions/upload-artifact@v5 and actions/download-artifact@v5 to commit SHAs like the other actions in ci.yml.
  • blvm-sdk's blvm-sign-binary writes "signer": hex("unknown") into signature files because the metadata has no signer key. Verification doesn't use it, but it is worth fixing in blvm-sdk.

Generated by Claude Code

…Nix flake

Each stable release now ships a verification bundle that maintainers can
rebuild against and sign, and that operators can check with one script.

- spec-evidence job: runs cargo spec-lock verify (strict, Z3, pinned 0.1.45)
  and check-drift on the blvm-consensus .crate that Cargo.lock pins, after
  checking the .crate against the lock checksum. verify failing blocks release.
- release-attestation.sh: writes blvm-<tag>-attestation.json, build-config.json
  and a deterministic verification bundle (checksums, spec-lock report, spec
  file hashes). source_hash, build_config_hash and spec_hash tie it together.
- Sigstore provenance now covers every release file, not only three binaries.
- ci-build-musl.sh: static x86_64 and aarch64 musl builds via cargo-zigbuild
  with path remapping for Rust and C. Non-blocking until first green run.
- release-bump-version.sh: one place for the version bump so rebuilds from a
  tag embed the same version string.
- sign-release.sh (rewritten): checks provenance and the bundle, rebuilds the
  musl binaries from the tag, and signs with blvm-sign-binary only on a match.
- verify-release.sh: checksums, provenance, bundle consistency, spec-lock
  result, and the maintainer threshold from the local release-keys/policy.json
  (no keys enrolled yet, threshold 0).
- flake.nix and nix/module.nix: source build against Cargo.lock with the
  release feature set, and a hardened NixOS service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PbsELQWoqXKfHJiFPi6vUy
@secsovereign

Copy link
Copy Markdown
Member Author

Security red (job 130991972826) is cargo audit, not this PR's code: 4 advisories in hickory-proto 0.25.2 (RUSTSEC-2026-0487, -0489, -0490, -0491; fix is >=0.26.2).

Path: hickory-proto 0.25.2 ← hickory-resolver 0.25.2 ← iroh-relay/iroh 0.95.1 ← blvm-node 0.1.92 (direct and via blvm-sdk 0.1.23).

A lockfile bump in this repo can't fix it, since iroh 0.95 pins hickory 0.25. The fix is to move blvm-node to an iroh release that depends on hickory ≥0.26.2 and then cascade node → sdk → blvm. Alternatively, as a stopgap, add these 4 IDs to the audit ignore list, with a note, until node ships. The other 9 entries are allowed unmaintained warnings and don't cause the failure.

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