Skip to content

fix(plugin): clear error on cosign legacy-bundle signatures#421

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/8-legacy-bundle-error
Jul 20, 2026
Merged

fix(plugin): clear error on cosign legacy-bundle signatures#421
scttfrdmn merged 1 commit into
mainfrom
fix/8-legacy-bundle-error

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Follow-up to increment 3 (spore-plugins#8).

spawn's signature verifier uses sigstore-go, which parses only the Sigstore protobuf bundle. A cosign legacy bundle ({base64Signature,cert,rekorBundle}, what cosign sign-blob --bundle writes without --new-bundle-format) failed with a cryptic proto: unknown field "base64Signature". This detects that shape up front and returns an actionable error pointing at --new-bundle-format.

Why it wasn't caught earlier

The hermetic tests use testing/ca.NewVirtualSigstore, which produces protobuf entities — so the legacy-bundle path was never exercised. Surfaced when re-cutting the first official release through the real workflow (see the companion registry fix spore-host/spore-plugins#14, which makes the workflow emit the new format).

Adds TestVerifyManifestSignature_RejectsLegacyBundle. This is defense-in-depth: the real fix is workflow-side (#14 emits the correct format); this makes spawn fail clearly rather than cryptically if a legacy bundle ever reaches it.

Refs #8. (Ships in the next spawn release; v0.86.0 already shipped with the cryptic-error version — not a regression, just a worse message.)

…ugins#8)

A cosign bundle written without --new-bundle-format uses the legacy shape
({base64Signature,cert,rekorBundle}), which sigstore-go can't parse — it failed
with a cryptic 'proto: unknown field base64Signature'. Detect that shape up
front and return an actionable error pointing at --new-bundle-format.

Found during the real-workflow signing smoke: the virtual-Sigstore unit tests
use protobuf entities, so they never exercised the legacy-bundle path. The
registry release workflow is being fixed to emit the new format (spore-plugins);
this makes spawn fail clearly if a legacy bundle ever reaches it.
@scttfrdmn
scttfrdmn merged commit a54d5d1 into main Jul 20, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the fix/8-legacy-bundle-error branch July 20, 2026 20:56
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

scttfrdmn added a commit that referenced this pull request Jul 20, 2026
…re-plugins#8) (#422)

Increment 4 of the registry supply-chain RFC. A successful plugin install now
records its resolved provenance in two places on the instance (beyond the
existing controller-side local record), so an audit can answer 'which plugin
bytes are on this box, and how were they verified' from both the AWS control
plane and the instance itself:

- EC2 tag: spore:plugin:<name> = version + content-digest/commit prefixes +
  verification tier (signature/manifest/none). Compact, well under EC2's
  256-char limit. Written via UpdateInstanceTags after a successful install.
- spored state: Provenance threaded through the install request →
  InstallWithProvenance → persisted in PluginState. 'spawn plugin status' shows
  a Source: line.

Both writes are best-effort — a tagging/state failure never fails an
already-completed install. InstallWithPushed now delegates to the new
InstallWithProvenance (nil prov = today's behavior); the install request gained
an optional provenance field (older controllers omit it).

Also documents the already-shipped legacy-bundle error fix (#421) in the
CHANGELOG. Tests: provenance persisted to state; tag-value builder (all tiers,
length bound).
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