Skip to content

fix(mountpoint-s3): verify the .deb; pin every artifact by sha256 + CI gate (#31) - #34

Merged
scttfrdmn merged 2 commits into
mainfrom
fix/31-pin-plugin-artifacts
Nov 8, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
fix/31-pin-plugin-artifacts

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #31

mountpoint-s3 v1.0.1

On Debian/Ubuntu the plugin checked the .deb against the .rpm's sha256. That check always failed, and || { echo note… } swallowed the failure, so apt-get install ran as root on an unverified package.

The four packages (.rpm and .deb for x86_64 and arm64) are now fetch steps, each pinned by sha256 and size and selected by arch. spored hashes each download as it writes it, and on a mismatch it deletes the file and fails the install, so the run step that installs never sees an unverified package. Because the pins are in plugin.yaml, the release manifest's cosign signature now covers the packages too.

  • AWS signature: AWS publishes a detached PGP signature (<url>.asc) for every Mountpoint package, and its key at mountpoint-s3-release/public_keys/KEYS. Each pin was taken from a package whose .asc verified against that key. All four 1.19.0 packages are signed by 673F E406 1506 BB46 9A0E F857 BE39 7A52 B086 DA5A, the older of the two fingerprints in Mountpoint's doc/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.
  • Not verified on-instance by PGP. The sha256 pin is the stronger binding, and the signature is checked where the pin is made and in CI, the same model spawn uses for its AWS CLI and EFA pins.
  • Mountpoint stays at 1.19.0, so nothing installed changes. 1.24.0 is out; bumping is a separate change.
  • Download size: with spawn's arch: (spawn#838) an instance fetches only its own architecture's .rpm and .deb, about 25 MB. The current spawn ignores arch: 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.
  • Needs spored ≥ v0.86.0 (2026-07-20), the first that checks a fetch's sha256.

CI: new Artifact pins job (lint.yml)

  • tests/artifact-pins.sh (hermetic, yq). It fails on:

    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 pinned fetch artifact and checks its sha256 and size. For mountpoint-s3-release URLs it also checks the .asc with gpgv against scripts/keys/mountpoint-s3.asc, which is AWS's KEYS file, 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 run step without a pin:

plugin unpinned download
cloudwatch-agent .../latest/amazon-cloudwatch-agent.rpm/.deb; fallback only, and amd64-only
code-server code-server.dev/install.sh | sh
docker get.docker.com | sh (non-dnf hosts)
github-actions-runner runner tarball; the version comes from config
globus-personal-endpoint globusconnectpersonal-latest.tgz
jupyterlab pip install jupyterlab, unpinned
rclone rclone.org/install.sh | bash
rstudio-server .rpm/.deb at whatever VERSION says
tailscale tailscale.com/install.sh | sh
vscode-tunnel .../latest/<arch>/stable

Fixing 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: sha256 is required on fetch (spawn#838). size and arch are documented, along with how to pin one artifact per architecture and "don't download in a run step".
  • Changelogs: plugins/mountpoint-s3/CHANGELOG.md (v1.0.1) and registry-level CHANGELOG.md (CI and docs).
  • index.json regenerated with spawn v0.161.0 (gen-index, stamp keyed to the spec commit).
  • Validated with spawn plugin validate --strict on all 12 plugins, using both released v0.161.0 and the spawn#1557 build.

Release order

  1. Merge this PR first. It works on the current spawn (v0.161.0), since arch:/size: are ignored there and every package is still sha256-checked.
  2. Owner pushes the tag git tag mountpoint-s3-v1.0.1 <merge-sha> && git push origin mountpoint-s3-v1.0.1. release.yml builds and cosign-signs the manifest keyless via OIDC; no secret is needed. Until that tag exists, a bare spawn plugin install mountpoint-s3 still resolves to v1.0.0, the unverified .deb.
  3. Then spawn#1557 (refuses an unpinned fetch, adds arch:/size:) ships in the next spawn release. No tagged plugin has a fetch step without sha256, so it breaks none.

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.
@scttfrdmn scttfrdmn added this to the Hardening milestone Nov 8, 2026
@scttfrdmn
scttfrdmn merged commit 6de86bd into main Nov 8, 2026
4 checks passed
@scttfrdmn
scttfrdmn deleted the fix/31-pin-plugin-artifacts branch November 8, 2026 21:58
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.

mountpoint-s3: the .deb is installed without verification (its checksum check always fails and is ignored)

1 participant