verify-action-build: credit in-tree binaries the rebuild reproduces - #1206
Open
potiuk wants to merge 1 commit into
Open
verify-action-build: credit in-tree binaries the rebuild reproduces#1206potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
The in-tree binary check only knew how to verify a binary against GitHub release provenance - a SLSA attestation or a SHA256SUMS asset. A bundler- copied dependency asset has neither and never will: 1Password/load-secrets- action's dist/core_bg.wasm is ncc output copied from @1password/sdk-core, pinned by sha512 integrity in package-lock.json, so PR apache#1195 hard-failed on a binary whose provenance chain is npm's rather than the action's. Delete those binaries from the output directory before the rebuild, as the minified JS already is, and credit any that come back byte-identical. That is the same guarantee the JS rebuild check gives. A fully-reproduced action now skips the release lookups entirely; everything else is unchanged. Generated-by: Claude Code (Opus 5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code change
Summary
The in-tree binary check could only verify a binary against GitHub release provenance - a SLSA attestation or a
SHA256SUMSasset. A binary a bundler copied intodist/out of a dependency has neither and never will, so the check rejected build output.Surfaced by #1195 (
1Password/load-secrets-actionv5.0.1). Itsdist/core_bg.wasmisnccoutput copied from@1password/sdk-core@0.5.0, whichpackage-lock.jsonpins with a sha512 integrity hash - the provenance chain exists, it is just npm's rather than the action's. (Upstream 1Password/load-secrets-action#186 asks them to publish attestations; this makes us able to verify it either way.).wasm,.node,.so,.dll,.dylib,.exe) from the output directory before the rebuild, exactly as the minified JS already is (build_action.Dockerfile).security.py,verification.py).SHA256SUMSlookups entirely.Binaries the rebuild does not reproduce - a committed launcher like
runs-on/action'smain-linux-amd64- are unaffected and still require attestation orSHA256SUMS.This does not by itself turn #1195 green. That PR also fails
Binary download verificationon threetc.downloadToolcalls that fetch theopCLI with no checksum (upstream 1Password/load-secrets-action#168) - untouched by the v5.0.1 bump, and the same shape is present in the already-approved v5.0.0. That finding needs its own decision.Type of change
Testing
uv run pytest utils/tests/- 332 passed.New tests for the reproduction match: identical credited, differing not credited, missing-from-rebuild not credited, nested paths, non-binaries ignored, missing dirs.
New
analyze_in_tree_binariestests: a reproduced binary passes without any release lookup being attempted, an unreproduced one still fails, and the credit does not leak to a sibling launcher binary.Verified end to end against the real action. The
verifyworkflow does not run on this PR - it touches neitheractions.ymlnor the dependabot composite, so its checks arepre-commit,test,rat,zizmor, CodeQL and the Analyze jobs. (An earlier version of this body wrongly saidverifycovers it.) Ran manually on this branch with Docker:The summary row goes from
In-tree binary check ✗ unverified binaries in repoonmainto✓ ... verified via rebuild / attestation / SHA256SUMS. The ncc rebuild does re-emit the wasm byte-identically, which was the open risk in the deletion step.Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting