Verifying a Release
Every file that SHA256SUMS lists, and SHA256SUMS itself, is covered by SLSA Build Level 3 provenance (SLSA v1.0 Build track), generated by the SLSA project's generic generator, slsa-github-generator v2.1.0 at commit f7dd8c54c2067bafc12ca7a55595d5ee9b75204a, in the SLSA Provenance v0.2 format. The provenance is the release asset mavlink-m-X.Y.Z.intoto.jsonl; it and the publication record are covered by GitHub's release attestation, which gh release verify-asset checks. Checking a file against it proves that this repository's release workflow, at that version's tag and commit, built the file on a GitHub-hosted runner and that the generator signed it. When the claim holds lists its conditions.
The checks below use the GitHub CLI; they were checked with gh 2.92.0. Set the version once:
TAG=vX.Y.Z; V=${TAG#v}; R=Dronecode/mavlink-military
GEN=slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml
GEN_SHA=f7dd8c54c2067bafc12ca7a55595d5ee9b75204a
SRC_SHA=$(gh api "repos/$R/commits/$TAG" --jq .sha)
gh release download "$TAG" -R "$R" -p FILE -p SHA256SUMS -p "mavlink-m-$V.intoto.jsonl"GEN_SHA is the generator commit that version's release used. The release workflow at the tag records it (GENERATOR_COMMIT in .github/workflows/release.yml), and so does the release's publication record. Take it from there if a later release moved to another generator version.
Check a file with gh
gh attestation verify FILE --bundle "mavlink-m-$V.intoto.jsonl" --repo "$R" \
--signer-workflow "$GEN" --signer-digest "$GEN_SHA" \
--source-ref "refs/tags/$TAG" --source-digest "$SRC_SHA" \
--predicate-type https://slsa.dev/provenance/v0.2 \
--deny-self-hosted-runnersThen check that the release workflow at the tag built it, which no flag pins; the command prints https://github.com/Dronecode/mavlink-military/.github/workflows/release.yml@refs/tags/vX.Y.Z:
gh attestation verify FILE --bundle "mavlink-m-$V.intoto.jsonl" --repo "$R" \
--signer-workflow "$GEN" --signer-digest "$GEN_SHA" \
--source-ref "refs/tags/$TAG" --source-digest "$SRC_SHA" \
--predicate-type https://slsa.dev/provenance/v0.2 --deny-self-hosted-runners \
--format json --jq '.[].verificationResult.signature.certificate.buildConfigURI'Finally, check the release and the file against GitHub's release attestation, and the file against SHA256SUMS:
gh release verify "$TAG" -R "$R"
gh release verify-asset "$TAG" FILE -R "$R"
sha256sum --check --ignore-missing SHA256SUMS| Flag | What it binds |
|---|---|
--bundle | The provenance file. The generator writes nothing to GitHub's attestation store, so this flag is required; without it, gh finds nothing. |
--repo | The source repository. |
--signer-workflow | The generator's workflow, at any ref. |
--signer-digest | The generator workflow's commit, whatever its tag says. |
--source-ref, --source-digest | The release tag and the commit it names. |
--predicate-type | The SLSA Provenance v0.2 format the generator writes; gh looks for v1 by default and finds nothing without this flag. |
--deny-self-hosted-runners | A GitHub-hosted runner built the file. |
Keep --source-ref and --source-digest. Another workflow run in this repository, such as one a pull request adds, could also obtain a signature from the same generator, naming this repository as its source; only the release tag and its commit tie a file to a release.
To pin the generator's tag as well as its commit, replace --signer-workflow "$GEN" with --cert-identity "https://github.com/$GEN@refs/tags/v2.1.0" and keep --signer-digest; gh does not take the two flags together.
Check the tag's signature
A maintainer signs every release tag with GPG, and the release refuses to build a tag that GitHub does not verify or that someone other than its signer pushed. GitHub shows a verified tag as Verified on the tag's page. To check it yourself, import the maintainer's public keys, which GitHub serves at https://github.com/USER.gpg, and verify the tag in a clone:
curl -fsSL https://github.com/USER.gpg | gpg --import
git fetch --tags https://github.com/Dronecode/mavlink-military
git tag -v "$TAG"The tag names the commit that the provenance's --source-digest binds, so a verified tag and a verified file together tie the release to the maintainer who made it.
Check a file offline
While online, save the trusted root once:
gh attestation trusted-root > trusted_root.jsonlThen run the first command above with --custom-trusted-root trusted_root.jsonl added; it needs no network. gh release verify and gh release verify-asset need the network.
Check a file with slsa-verifier
The SLSA project's slsa-verifier checks the same provenance, online:
slsa-verifier verify-artifact FILE \
--provenance-path "mavlink-m-$V.intoto.jsonl" \
--source-uri "github.com/$R" \
--source-tag "$TAG" \
--builder-id "https://github.com/$GEN@refs/tags/v2.1.0"Keep --source-tag, for the reason the gh section gives. slsa-verifier pins the generator by its tag and has no flag for its commit, so the gh check with --signer-digest is the stronger one. Get slsa-verifier from its GitHub release, checking the asset's digest, or with go install github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier@v2.7.1.
Rebuild it
The package files rebuild byte for byte. From a clone of this repository:
git checkout "$TAG"
. .github/mavlink-pins.env # MAVLINK_REF and PYMAVLINK_REF
git clone https://github.com/mavlink/mavlink.git mavlink && git -C mavlink checkout "$MAVLINK_REF"
PYMAVLINK_REPO=$(python3 -c 'import sys; sys.path.insert(0, ".github/scripts/generate_c_lib"); import check_pins_upstream as c; print(c.read_repositories(c.ACTION, ["pymavlink"])["pymavlink"])') # where the setup action checks pymavlink out from
git clone "https://github.com/$PYMAVLINK_REPO.git" pymavlink && git -C pymavlink checkout "$PYMAVLINK_REF"
python3.12 -m venv .venv && .venv/bin/pip install --require-hashes --only-binary :all: --no-deps -r .github/requirements/generator.txt
gh release download "$TAG" -R "$R" -p "mavlink-m-$V-evidence.tar.gz" -p SHA256SUMS
tar -xzf "mavlink-m-$V-evidence.tar.gz" "mavlink-m-$V-evidence/plan.json"
MAVLINK_DIR=mavlink PYMAVLINK_DIR=pymavlink .venv/bin/python .github/scripts/release/release_package.py "mavlink-m-$V-evidence/plan.json" rebuilt
(cd rebuilt && sha256sum --check --ignore-missing ../SHA256SUMS)The archives' compressed bytes depend on the zlib that writes them; the manifest records each archive's uncompressed tar digest, which does not.
Check your own build against a release
Bindings you generated yourself, or took from elsewhere, can be checked against a release without trusting its notes:
C: every row of
MAVLINK_MESSAGE_CRCSin yourmilitary/military.hmust give the release'swire.jsonvalues for that message: CRC_EXTRA and the minimum and maximum lengths.shgh release download "$TAG" -R "$R" -p "mavlink-m-$V-wire.json" python3 - "mavlink-m-$V-wire.json" path/to/military/military.h <<'EOF' import json, re, sys table = json.load(open(sys.argv[1])) rows = {int(r[0]): tuple(map(int, r[1:4])) for r in re.findall(r"\{(\d+), (\d+), (\d+), (\d+), \d+, \d+, \d+\}", open(sys.argv[2]).read())} bad = [m["name"] for m in table["messages"] if rows.get(m["id"]) != (m["crc_extra"], m["min_length"], m["max_length"])] print("differing messages:", bad or "none") sys.exit(1 if bad else 0) EOFPython: your
military.pymust have the SHA-256 that the release's manifest gives it in the Python archive, or must equal one you regenerate at the release's pins as Rebuild it shows.The definitions: your
military.xmlmust have the SHA-256 ofmavlink-m-X.Y.Z-military.xmlin the release'sSHA256SUMS.
When the Level 3 claim holds
The claim holds only while all of these hold:
- The provenance comes from the generator at the tag and commit above, checked as shown.
- Every job of the release run is GitHub-hosted, uses no cache and reads nothing another run produced, and no job that builds the release can sign.
- The provenance is published with each release and in the public transparency log, with these instructions.
- The generator's own jobs, which run on GitHub-hosted runners and fetch the generator's builder from its release, are part of the trusted builder, outside this project's control.
The claim is about the Build track only; it makes no claim about source controls.
What the provenance records, and what it does not
- The format is SLSA Provenance v0.2. The SLSA specification marks a later version as current, and policy tools that expect the v1 shape need a mapping.
materialslists only this repository at the release commit; the generator marks the materials incomplete. The tool versions, the Python lock and the generator pins are in the release's evidence bundle and SBOM instead.- The generator also records
reproducible: false, a statement about itself; the release's own two-build comparison is the reproducibility evidence. - The provenance publishes the release run's GitHub context, permanently, in the release and in the transparency log: the push event, including the account that pushed the tag, and the repository's configuration variables. The release workflow refuses to sign while any configuration variable is set. A maintainer who keeps their GitHub email address private has a no-reply address recorded instead of their own.