Repository navigation
fix(mountpoint-s3): verify the .deb; pin every artifact by sha256 + CI gate (#31) - #34
Merged
Merged
Conversation
mountpoint-s3 checked its .deb against the .rpm's sha256, so the check always
failed, `|| { echo note… }` swallowed it, and apt-get installed an unverified
package as root. The four packages (.rpm/.deb x two architectures) are now
pinned fetch steps with sha256 + size + arch, so spored verifies each before
anything uses it and the release signature covers them. v1.0.1.
Each pin was taken from a package whose .asc verified against AWS's Mountpoint
release key. CI gains an "Artifact pins" job: tests/artifact-pins.sh (hermetic:
no swallowed sha256sum -c, no unpinned fetch, no new curl/wget/pip in a remote
run step; the ten plugins that still do are listed and tracked in #33) and
scripts/verify-artifact-pins.sh (downloads every pinned artifact; checks
sha256, size and, for Mountpoint, AWS's PGP signature against the committed key
pinned by AWS's published fingerprints).
AUTHORING.md documents sha256 as required (spawn#838), size and arch.
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.
Fixes #31
mountpoint-s3 v1.0.1
On Debian/Ubuntu the plugin checked the
.debagainst the.rpm's sha256. That check always failed, and|| { echo note… }swallowed the failure, soapt-get installran as root on an unverified package.The four packages (
.rpmand.debfor x86_64 and arm64) are nowfetchsteps, each pinned bysha256andsizeand selected byarch. spored hashes each download as it writes it, and on a mismatch it deletes the file and fails the install, so therunstep that installs never sees an unverified package. Because the pins are inplugin.yaml, the release manifest's cosign signature now covers the packages too.<url>.asc) for every Mountpoint package, and its key atmountpoint-s3-release/public_keys/KEYS. Each pin was taken from a package whose.ascverified against that key. All four 1.19.0 packages are signed by673F E406 1506 BB46 9A0E F857 BE39 7A52 B086 DA5A, the older of the two fingerprints in Mountpoint'sdoc/INSTALL.md. That key has expired since, but it was valid when it signed; gpgv reports a good signature. The hashes match the ones measured in mountpoint-s3: the .deb is installed without verification (its checksum check always fails and is ignored) #31.arch:(spawn#838) an instance fetches only its own architecture's.rpmand.deb, about 25 MB. The current spawn ignoresarch:and fetches all four, about 51 MB, each still verified. It used to be one package, about 13 MB. The packages go to/opt/spore-plugins/mountpoint-s3/and are removed after install.sha256.CI: new
Artifact pinsjob (lint.yml)tests/artifact-pins.sh(hermetic, yq). It fails on:sha256sum -c/shasum -cwhose failure is caught by||(the check mountpoint-s3: the .deb is installed without verification (its checksum check always fails and is ignored) #31 asked for);fetchstep withoutsha256;curl,wget(except to localhost) orpip installin a remoterunstep of a plugin not listed inUNPINNED.A listed plugin that stops downloading also fails the job, so the list only shrinks. I watched it fail against the old mountpoint-s3 spec (both the swallowed check and the curl downloads) and against an injected curl in spore-sync.
scripts/verify-artifact-pins.sh(network, no credentials). It downloads every pinnedfetchartifact and checks its sha256 and size. Formountpoint-s3-releaseURLs it also checks the.ascwith gpgv againstscripts/keys/mountpoint-s3.asc, which is AWS'sKEYSfile, committed. The script refuses to run if that file's keys aren't exactly AWS's two published fingerprints. A deliberately wrong pin fails it.Other plugins: unpinned downloads (not fixed here, listed in #33)
Ten of the twelve plugins download in a remote
runstep without a pin:.../latest/amazon-cloudwatch-agent.rpm/.deb; fallback only, and amd64-onlycode-server.dev/install.sh | shget.docker.com | sh(non-dnf hosts)globusconnectpersonal-latest.tgzpip install jupyterlab, unpinnedrclone.org/install.sh | bash.rpm/.debat whateverVERSIONsaystailscale.com/install.sh | sh.../latest/<arch>/stableFixing each one changes what gets installed and needs a real-instance install to prove it, and I had no AWS access. Several also need a decision: pinning a "latest" means dropping auto-update, and github-actions-runner's version is a config key. So they are tracked in #33 rather than rewritten blind. The CI gate stops the list growing.
Also
AUTHORING.md:sha256is required onfetch(spawn#838).sizeandarchare documented, along with how to pin one artifact per architecture and "don't download in arunstep".plugins/mountpoint-s3/CHANGELOG.md(v1.0.1) and registry-levelCHANGELOG.md(CI and docs).index.jsonregenerated with spawn v0.161.0 (gen-index, stamp keyed to the spec commit).spawn plugin validate --stricton all 12 plugins, using both released v0.161.0 and the spawn#1557 build.Release order
arch:/size:are ignored there and every package is still sha256-checked.git tag mountpoint-s3-v1.0.1 <merge-sha> && git push origin mountpoint-s3-v1.0.1.release.ymlbuilds and cosign-signs the manifest keyless via OIDC; no secret is needed. Until that tag exists, a barespawn plugin install mountpoint-s3still resolves to v1.0.0, the unverified.deb.fetch, addsarch:/size:) ships in the next spawn release. No tagged plugin has afetchstep withoutsha256, so it breaks none.