Skip to content

Optional spored signature verification (#26)#35

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/spored-sig-verify
Jul 21, 2026
Merged

Optional spored signature verification (#26)#35
scttfrdmn merged 1 commit into
mainfrom
feat/spored-sig-verify

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Hardens the bootstrap: spawn-ts's install verified only the SHA256 checksum (guards corruption — but the checksum sits in the same S3 bucket as the binary, so it can't prove authenticity). This ports the Go bootstrap's optional publisher-signature path. Closes #26.

  • New EC2ProviderOptions.sporedSigningPublicKey (PEM). When set, userdata.ts writes it to /etc/spawn/spored-signing-key.pem, downloads <binary>.sig (from the checksum URL), base64→DER, and openssl dgst -sha256 -verifys it before the atomic install — fail-closed on a missing or invalid signature.
  • The key is carried by the launcher (trusted), not served from the binary's bucket, so a bucket compromise can't forge it (spore-host#440).
  • Default unchanged: checksum-only, matching the Go tool when no signing key is compiled in.

Tests: verify block present-when-keyed / absent-by-default / blank-key-disabled, fail-closed messages, verify-runs-before-install ordering, and the key flowing through EC2Provider into the base64 user-data. Docs (architecture.md) state the trust model (checksum = integrity; signature = authenticity). 248 tests, build green.

Port the Go bootstrap's SPORED_SIG_VERIFY path. An EC2Provider
sporedSigningPublicKey (PEM) makes the userdata write the key to
/etc/spawn/spored-signing-key.pem, download <binary>.sig, base64→DER, and
`openssl dgst -sha256 -verify` it before the atomic install — fail-closed on a
missing or bad signature. The checksum (integrity, corruption) always runs; the
signature (authenticity) is opt-in. Key is carried by the launcher, not served
from the binary's S3 bucket, so a bucket compromise can't forge it (#440).

Default stays checksum-only, matching the Go tool when no key is compiled in.
Tests: block present/absent + fail-closed messages + verify-before-install
ordering + the key flowing through EC2Provider into the base64 user-data. Docs
(architecture.md) note the trust model. 248 tests.
@scttfrdmn
scttfrdmn merged commit c62a690 into main Jul 21, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the feat/spored-sig-verify branch July 21, 2026 21:25
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.

spored binary signature verification (optional)

1 participant