feat(plugin): 'plugin validate --strict' permission/step consistency check#423
Merged
Conversation
…check (spore-plugins#8) Increment 5 (final) of the registry supply-chain RFC. Adds ValidatePermissionConsistency + a --strict flag on 'spawn plugin validate' that cross-checks a declared permissions: block against the plugin's actual steps, so the declaration surfaced by 'plugin inspect' is enforced, not decorative: - instance.root=false ⇒ no remote step that runs as root (a run step needs as_user; fetch/extract always run as root) - instance.network=false ⇒ no fetch step - controller.network=false ⇒ no local fetch/URL step - a permissions: block is required under --strict Base Validate (always-on, lenient) is unchanged; --strict is opt-in and run by the official registry's lint CI. New ValidateSpecFileStrict wrapper. Tests cover each mismatch + the consistent cases + the missing-block case.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Increment 5 (final integrity increment) of the registry supply-chain RFC (spore-plugins#8, decision #6).
What
Adds
ValidatePermissionConsistency+ a--strictflag onspawn plugin validatethat cross-checks a plugin's declaredpermissions:block against its actual steps — so the declarationspawn plugin inspectsurfaces is enforced, closing the inspect-then-install TOCTOU:instance.root=false⇒ no remote step that runs as root (arunstep needsas_user;fetch/extractalways run as root, mirroring spored)instance.network=false⇒ nofetchstepcontroller.network=false⇒ no localfetch/URL step--strictrequires apermissions:block to be presentBase
Validate(always-on, intentionally lenient) is unchanged;--strictis opt-in and run by the official registry's lint CI (companion PR spore-host/spore-plugins#15). NewValidateSpecFileStrictwrapper.Tests
ValidatePermissionConsistencyacross each mismatch (root/instance-network/controller-network), the consistent cases (root=true with root steps; root=false with only as_user steps), and the missing-permissions-block case.gofmt/vet/semgrep clean; docs regenerated for the new flag.
Companion registry PR adds accurate
permissions:blocks to all 4 plugins and switches lint to--strict: spore-host/spore-plugins#15.Refs #8. Completes the RFC's five increments (1 fetch-sha256, 2 manifest, 3 signing, 4 on-instance provenance, 5 this).