docs: sign the packaged payload, not the checkout - #79
Open
DeepDiver1975 wants to merge 1 commit into
Open
DeepDiver1975 wants to merge 1 commit into
DeepDiver1975 wants to merge 1 commit into
Conversation
The reference developer signing workflow in attestation/CRL spec §2 ran `ocsign --path .`, which in a GitHub Actions job is the actions/checkout tree. In app mode the manifest hashes everything under --path bar appinfo/signature.json and OS cruft, so that command signs .git, tests/ and .github/ as part of the app -- and the result verifies, because the manifest genuinely describes the tree that was signed. files_antivirus v1.3.1 shipped exactly this: a ~1 MB archive carrying the whole checkout, manifest over 537 paths including .git/config. ocsign now refuses such a --path (owncloud/ocsign#21), so §2 as written exits 1. §2 now packages first (staging dir, e.g. build/artifacts/appstore/<app>), signs that directory, and rolls the tarball from the signed tree, with the payload rule stated normatively: the signed tree and the shipped tree must be the same tree, and --allow-vcs must never appear in a release pipeline. The "full YAML" §2 pointed at did not exist -- the same reference workflow was promised in developer-documentation spec §9 and design §16 as well. It is now written, as §4.1 of both the developer-documentation spec and the published developer guide, in the correct package -> sign -> tar order. Verified against ocsign v0.3.0: the documented invocation exits 0 and the old `--path .` form exits 1; the resulting archive holds only the payload. Closes #77 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
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.
Why
spec-attestation-and-crl-workflows.md§2 — the copy-paste reference signingworkflow developers put in their app repo — ran:
In a GitHub Actions job
.is theactions/checkouttree. In app mode themanifest hashes everything under
--pathbarappinfo/signature.jsonand OScruft, so that signs
.git,tests/,.github/and build scratch as part ofthe app — and it verifies, because the manifest genuinely describes the tree
that was signed. Nothing downstream can catch it.
Not hypothetical: files_antivirus v1.3.1
shipped as a ~1 MB archive (vs ~165 KB for prior releases) containing the whole
checkout, with a manifest over 537 paths including
.git/configand.git/index— while the correct payload built by
make appstoresat unsigned inside thatsame archive. owncloud/ocsign#21 now refuses such a
--path, so §2 as writtenexits 1.
While fixing it: the "full YAML" §2 pointed at did not exist. The same
reference workflow is promised in developer-documentation spec §9 and design §16
— three dangling pointers. It is now written.
What changed
tar the signed tree, with the payload rule stated normatively: the signed tree
and the shipped tree must be the same tree; a staging dir inside the checkout
(
build/artifacts/appstore/<app>) is fine because the guard only looks for.gitunder--path;--allow-vcsMUST NOT appear in a release pipeline.the correct order, plus a
--pathwarning on §4 and the §1/§9 cross-references.the
--pathwarning and the §8 link. YAML is byte-identical to the spec's barone comment (
see §5vsITEM #2).Workflow design notes: only
actions/checkoutis used, pinned to a full SHA(
3d3c42e5…v7.0.1, same pin as.github/workflows/validate.yml); the releaseupload uses the pre-installed
ghrather than a third-party action, so there isexactly one SHA for developers to keep current.
ocsigninstall pins the releasetag and verifies against that release's
SHA256SUMS. The--atteststep shipscommented out, pointing at ITEM #2.
Verification
yaml.safe_load); the two issueforms are undisturbed.
SHA256SUMSentries are./-prefixed and the archive member is
./ocsign, sosha256sum --ignore-missing --checkandtar -xzf "$archive" ./ocsignare what actually work (a bareocsignmember name fails; verified).--ignore-missingis non-vacuous — itexits 1 when no file was verified.
ocsign v0.3.0 --help.ocsign v0.3.0in a real git checkout: signingbuild/artifacts/appstore/example-appexits 0 and writesappinfo/signature.json; the old--path .form exits 1. The tarball rolled bythe last step contains only
example-app/{appinfo,lib}— no.git, notests/, no.github/.go test ./...green (docs-only change).grepsweep: every "reference workflow" pointer now resolves to §4.1.Out of scope:
spec-go-signing-tool.md§2's missing--allow-vcs/--versionflags and the new exit-1 condition — that is #78.
Closes #77
🤖 Generated with Claude Code