Enforce catalog provenance for plugin installs - #6653
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6653 +/- ##
=======================================
Coverage 78.93% 78.93%
=======================================
Files 782 782
Lines 78065 78136 +71
=======================================
+ Hits 61620 61678 +58
- Misses 16440 16453 +13
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JAORMX
left a comment
There was a problem hiding this comment.
Ran a panel review (security, code-quality, architecture) over this diff. Overall this is a well-structured change with tight, faithful parity to the existing skills trust-on-first-use model, and no exploitable bypass was found — CatalogProvenance isn't reachable from the HTTP API or CLI, --allow-unsigned/--public-key correctly can't override catalog policy, and lock-entry precedence (including legacy entries) is correctly enforced with no path to force a re-first-use.
Two inline findings are blocking (a contradictory --public-key remedy for key-signed artifacts under a catalog constraint, and a grammatically broken error string) — the first is compounded by a test that asserts the current, wrong message, so it won't catch a fix. The rest are inline nice-to-haves (duplicated resolution block, minor consistency/doc gaps, a defense-in-depth suggestion around AllowSignerChange).
Also noting: the size/L label undercounts how contained this is — excluding tests/docs (per the repo's own PR-size convention), production code is ~180 changed lines across 5 files, well within the normal guideline.
Signed-off-by: Samuele Verzi <samu@stacklok.com>
Signed-off-by: Samuele Verzi <samu@stacklok.com>
21179ee to
3269d8f
Compare
Summary
--allow-unsignedcannot bypass catalog policy, and certificate-shaped policies reject--public-key.Fixes #6643
Type of change
Test plan
task test)task test-e2e)task lint)Changes
pkg/api/server.gopkg/api/server_test.gopkg/plugins/options.gopkg/plugins/pluginsvc/service.gopkg/plugins/pluginsvc/install.gopkg/plugins/pluginsvc/verify.gopkg/plugins/pluginsvc/install_registry_test.gopkg/plugins/pluginsvc/verify_test.godocs/arch/14-plugins-system.mdDoes this introduce a user-facing change?
Yes. A first project-scoped plugin install resolved by registry name must satisfy provenance constraints declared by that catalog entry. Direct-reference and user-scoped installs retain their existing behavior.
Implementation plan
Approved implementation plan
Special notes for reviewers
mainalready depends on toolhive-core v0.0.47, which includes the plugin provenance type released in v0.0.46. This PR therefore contains no dependency bump. Any existing plugin lock entry, including a legacy entry without trust state, takes precedence over catalog policy.