Skip to content

verify-action-build: verify in-tree binaries (attestation / SHA256SUMS)#819

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:reject-in-tree-binaries
May 11, 2026
Merged

verify-action-build: verify in-tree binaries (attestation / SHA256SUMS)#819
potiuk merged 2 commits into
apache:mainfrom
potiuk:reject-in-tree-binaries

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 7, 2026

Summary

  • Add an In-tree binary check to verify-action-build. Detects actions that ship pre-compiled native binaries directly in the repo (Go cross-compiled like main-linux-amd64, plus *.exe/*.dll/*.so/*.dylib/*.jar/*.wasm, etc.) and exec them from a small launcher.
  • For each detected binary, verify against upstream provenance via a cascade:
    1. gh attestation verify --owner <org> — queries the GitHub attestation transparency log (populated by actions/attest-build-provenance).
    2. SHA256SUMS release asset — fetches the release's checksum file and SHA256-compares each binary.
    3. Neither — hard fail. Action runs opaque code; reject until upstream adds provenance.
  • Verified binaries are reported ✓ with the verification mechanism. Unverified binaries fail the action with offending paths named.
  • Document the new check in README's security review checklist + add case F to the analyze-action-pr skill, with runs-on/[email protected] (rejected — no provenance) and v2.1.2 (verified — both attestation and SHA256SUMS) as precedents.

Test plan

  • uv run pytest utils/tests/ — 236/236 (15 new for in-tree binaries + 6 new for SHA256SUMS parser).
  • prek run --all-files clean.
  • Reject case (runs-on/[email protected]): no provenance — 3 binaries flagged as unverified, action fails.
  • Verify case (runs-on/[email protected]): upstream landed actions/attest-build-provenance + SHA256SUMS after our issue runs-on/action#36 — all 3 binaries verified via gh attestation verify, action passes (exit 0).

Background

Closes the gap surfaced by #809 (runs-on/[email protected]). The maintainer (@crohr) responded to our upstream ask by adding both verification mechanisms in runs-on/action#37; v2.1.2 is now fully verifiable, which is what #825 (the v2.1.2 dependabot bump) needs from us.

Generated-by Claude Code.

@potiuk potiuk requested a review from dfoulks1 as a code owner May 7, 2026 16:46
@potiuk potiuk requested review from dave2wave and raboof May 7, 2026 16:46
@dave2wave
Copy link
Copy Markdown
Member

My approval is contingent on @gmcdonald confirming that runs-on has been rejected as a vendor.

If it still needs to be used then I think we will need an allow-list of actions that pass verify. Maybe these are ones we can wildcard.

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented May 7, 2026

My approval is contingent on @gmcdonald confirming that runs-on has been rejected as a vendor.

If it still needs to be used then I think we will need an allow-list of actions that pass verify. Maybe these are ones we can wildcard.

Note that failing the test does not mean rejection. It just means failing the test. It can still be approved.

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented May 7, 2026

My approval is contingent on @gmcdonald confirming that runs-on has been rejected as a vendor.

If it still needs to be used then I think we will need an allow-list of actions that pass verify. Maybe these are ones we can wildcard.

Also - if you look there runs-on/action#36 The maintainer had been very responsive and implemented attestation for building those binaries (cc: @ppkarwasz ) - so we still might allow the actions where attestations are present - they do not give us 100% reproducibility - but I think the trust in this case moves from the author to GitHub + review of the build steps. Am I right Piotr?

@potiuk potiuk changed the title verify-action-build: reject actions that ship pre-compiled binaries verify-action-build: verify in-tree binaries (attestation / SHA256SUMS) May 9, 2026
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented May 9, 2026

My approval is contingent on @gmcdonald confirming that runs-on has been rejected as a vendor.

If it still needs to be used then I think we will need an allow-list of actions that pass verify. Maybe these are ones we can wildcard.

Also ... I added (as a follow-up after the fix implemented by @crohr in runs-on/action#36 -> this check will now only fail if we "can't" verify the binary - wiht either binary attestations or SHASUM approch. This PR has been tested on #825 and it correctly verify the attested binaries - with SLSA attestations of build:

image

Where it fails on previous version of the same bump, where the action did not have attestations:

image

Which is probably exactly what we want.

Copy link
Copy Markdown
Member

@dave2wave dave2wave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@potiuk potiuk force-pushed the reject-in-tree-binaries branch from 2e200bb to 3f2fc7e Compare May 11, 2026 21:30
potiuk added 2 commits May 11, 2026 23:38
…n-tree

Add `analyze_in_tree_binaries` to flag actions that commit native
binaries (Go cross-compile, .exe/.dll/.so/.dylib/.jar/.wasm, etc.)
directly in their repo and exec them from a small launcher.  The
JS-rebuild check verifies the launcher; the binaries are opaque
executable code that no part of our pipeline can reconcile with
source.  runs-on/[email protected] (apache#809)
is the case in point — ~10 MB of UPX-packed Go binaries run as root.

The check is path-only (cheap, no fetch): known binary extensions
plus the <name>-<os>-<arch>(.exe)? cross-compile suffix.  Add the
new failure path to the verification summary and overall result.

Also document the criterion in the security review checklist and
add case F (in-tree native binaries) + a runs-on/action precedent
to the analyze-action-pr skill.
…6SUMS

The previous In-tree binary check was a flat reject of any
pre-compiled native binary in an action's tree.  That blocked
runs-on/action and similar Go-based actions outright, with no
path forward except "wait for upstream to fix it".

The runs-on/action maintainer responded to our upstream issue
(runs-on/action#36) by wiring actions/attest-build-provenance
into the release workflow and shipping a SHA256SUMS asset
(runs-on/action#37) — exactly the chain we asked for.  v2.1.2's
binaries are now verifiable end-to-end.

Extend analyze_in_tree_binaries to use that chain.  Each detected
binary is verified through a cascade:
  1. gh attestation verify --owner <org>: queries GitHub's
     attestation transparency log; ties the binary's SHA256 to
     the workflow run that produced it.
  2. SHA256SUMS release asset: fetches the release's SHA256SUMS,
     compares each binary's filename + SHA256 hash.
  3. Neither: hard fail (the original behaviour, kept for actions
     with no provenance chain).

Verified binaries are reported ✓ with the verification mechanism.
Unverified binaries fail the action with the offending paths so
reviewers can confirm.

8 new tests covering each branch of the cascade plus 6 tests for
the SHA256SUMS parser.  Update SKILL.md case F + README review
checklist to reflect the new "verified ✓ / unverified ✗"
semantics; add a runs-on/action v2.1.2 precedent showing the
verification chain in action.
@potiuk potiuk force-pushed the reject-in-tree-binaries branch from 3f2fc7e to a374d05 Compare May 11, 2026 21:39
@potiuk potiuk merged commit 9afc9be into apache:main May 11, 2026
8 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.

2 participants