Repository navigation
feat(plugin): verify official installs against a release checksum manifest - #419
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Real-AWS smoke ✅ (gated: TTL 30m, profile spore-host-dev, acct 435415984226)Cut a real GitHub Release in spore-plugins — Controller-side verification (the whole new path), against the real release:
Full install on a real t3.small: 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.
d2a21c0 to
3ed4169
Compare
Increment 2 of the registry supply-chain RFC (spore-plugins#8).
What
Installing
[email protected]from the official registry now:name-vX.Y.Z,plugin.yamlat that tag, andmanifest.jsonasset 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 inspectshowsmanifest-verified ✓.pkg/plugin/manifest.go—Manifesttype +BuildManifest/ParseManifest/Encode, schema-versioned (fails closed on an unknown version), coversplugin.yaml(the sole executed artifact).pkg/plugin/registry.go— official version→tag mapping,verifyManifest,Provenance.{ManifestVerified,ReleaseTag}.cmd— newspawn 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.yamlbut the registry layout is…/plugins/<name>/plugin.yaml, sospawn plugin install <name>against the official registry 404'd (only local./pathand third-partygithub:refs ever worked). Official refs now use theplugins/<name>/layout. Confirmed against real raw.githubusercontent.com: old path → 404, new path → 200.Tests
Manifestround-trip,ParseManifestrejections (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).