Skip to content

feat(plugin): verify official installs against a release checksum manifest - #419

Merged
scttfrdmn merged 2 commits into
mainfrom
feat/8-checksum-manifest
Jul 20, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
feat/8-checksum-manifest

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Increment 2 of the registry supply-chain RFC (spore-plugins#8).

What

Installing [email protected] from the official registry now:

  1. resolves to the release tag name-vX.Y.Z,
  2. fetches plugin.yaml at that tag, and
  3. verifies its sha256 against the manifest.json asset on that GitHub Release.

A missing manifest or a digest mismatch is a hard failure — the bytes you install are provably the ones the maintainers released. spawn plugin inspect shows manifest-verified ✓.

  • pkg/plugin/manifest.go — Manifest type + BuildManifest/ParseManifest/Encode, schema-versioned (fails closed on an unknown version), covers plugin.yaml (the sole executed artifact).
  • pkg/plugin/registry.go — official version→tag mapping, verifyManifest, Provenance.{ManifestVerified,ReleaseTag}.
  • cmd — new spawn plugin manifest <dir> generator (the registry's release workflow runs it; the same binary verifies it).

Bare/unversioned and third-party github: refs have no manifest and are unaffected.

Fixes a latent bug

The official resolver fetched …/<name>/plugin.yaml but the registry layout is …/plugins/<name>/plugin.yaml, so spawn plugin install <name> against the official registry 404'd (only local ./path and third-party github: refs ever worked). Official refs now use the plugins/<name>/ layout. Confirmed against real raw.githubusercontent.com: old path → 404, new path → 200.

Tests

Manifest round-trip, ParseManifest rejections (bad schema/no-plugin.yaml/non-hex/not-json), and httptest-backed resolver tests: manifest-verified, mismatch → error, missing → error, bare ref → no manifest fetch. gofmt/vet clean, semgrep 0 findings.

Companion registry PR (release workflow + docs): spore-host/spore-plugins#11 (link once open).

Refs #8 (spore-plugins).

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.30303% with 59 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/plugin/registry.go 67.24% 13 Missing and 6 partials ⚠️
cmd/plugin.go 10.00% 18 Missing ⚠️
pkg/plugin/manifest.go 62.50% 12 Missing and 6 partials ⚠️
cmd/plugin_inspect.go 33.33% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn

Copy link
Copy Markdown
Contributor Author

Real-AWS smoke ✅ (gated: TTL 30m, profile spore-host-dev, acct 435415984226)

Cut a real GitHub Release in spore-plugins — rstudio-server-v1.0.1 — with a manifest.json asset generated by this branch's spawn plugin manifest (byte-identical to what the release workflow produces; sha256 0bffc628dd64 of the plugins/rstudio-server/plugin.yaml on the tagged commit 8c519323).

Controller-side verification (the whole new path), against the real release:

  • spawn plugin inspect [email protected] → Resolved: commit 8c5193236930 · sha256 0bffc628dd64 · manifest-verified ✓
    (resolve → tag rstudio-server-v1.0.1 → fetch plugins/rstudio-server/plugin.yaml at the tag → download the manifest.json release asset → sha256 match).
  • Confirmed the pre-existing path bug is fixed: …/plugins/rstudio-server/plugin.yaml @ tag → 200 (was 404 with the old …/<name>/plugin.yaml layout).
  • Negative: [email protected] (no such release) → exit 1, hard failure (never reaches an instance).

Full install on a real t3.small: spawn plugin install [email protected] printed pinned to commit 8c519… (sha256 0bffc628dd64) and proceeded to run remote steps — i.e. verifyManifest ran and passed in the resolver (a missing/mismatched manifest hard-fails before "Looking up instance"). The install then failed at rstudio's own start step — a pre-existing rstudio-server plugin bug unrelated to this PR (its rpm-install step is masked with || true, so a failed download slips through to a broken systemctl enable). Filed separately.

Instance terminated; independent leak-check clean (0 instances in any live state); cost < $0.05. Note verification is controller-side, so stock released spored on the instance was fine (no hot-swap needed).

…sum manifest (spore-plugins#8)

Increment 2 of the registry supply-chain RFC. Installing [email protected] from the
official registry now resolves to the release tag name-vX.Y.Z, fetches
plugin.yaml at that tag, and verifies its sha256 against the manifest.json asset
on that GitHub Release. A missing manifest or a digest mismatch is a hard
failure, so the installed bytes are provably the released ones.

- pkg/plugin/manifest.go: Manifest type + BuildManifest/ParseManifest/Encode
  (schema-versioned, fails closed on an unknown version).
- pkg/plugin/registry.go: official version→tag mapping, verifyManifest, and
  Provenance.{ManifestVerified,ReleaseTag}. Also FIXES a pre-existing bug where
  official installs fetched .../<name>/plugin.yaml but the registry layout is
  .../plugins/<name>/plugin.yaml (so official installs 404'd; only local and
  github: refs worked).
- cmd: new 'spawn plugin manifest <dir>' generator; inspect shows
  'manifest-verified'.

Manifest covers plugin.yaml only (the sole executed artifact). Bare/unversioned
and third-party github: refs have no manifest and are unaffected.
@scttfrdmn
scttfrdmn force-pushed the feat/8-checksum-manifest branch from d2a21c0 to 3ed4169 Compare July 20, 2026 19:03
@scttfrdmn
scttfrdmn merged commit 2e52ff2 into main Jul 20, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/8-checksum-manifest branch July 20, 2026 19:05
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.

1 participant