Skip to content

feat(plugin): 'plugin validate --strict' permission/step consistency check#423

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/8-strict-validate
Jul 20, 2026
Merged

feat(plugin): 'plugin validate --strict' permission/step consistency check#423
scttfrdmn merged 1 commit into
mainfrom
feat/8-strict-validate

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Increment 5 (final integrity increment) of the registry supply-chain RFC (spore-plugins#8, decision #6).

What

Adds ValidatePermissionConsistency + a --strict flag on spawn plugin validate that cross-checks a plugin's declared permissions: block against its actual steps — so the declaration spawn plugin inspect surfaces is enforced, closing the inspect-then-install TOCTOU:

  • instance.root=false ⇒ no remote step that runs as root (a run step needs as_user; fetch/extract always run as root, mirroring spored)
  • instance.network=false ⇒ no fetch step
  • controller.network=false ⇒ no local fetch/URL step
  • --strict requires a permissions: block to be present

Base Validate (always-on, intentionally lenient) is unchanged; --strict is opt-in and run by the official registry's lint CI (companion PR spore-host/spore-plugins#15). New ValidateSpecFileStrict wrapper.

Tests

ValidatePermissionConsistency across 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).

…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.
@scttfrdmn
scttfrdmn merged commit 4d1c73d into main Jul 20, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the feat/8-strict-validate branch July 20, 2026 21:31
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/plugin/validate.go 84.37% 10 Missing ⚠️
cmd/plugin.go 16.66% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

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