Optional spored signature verification (#26)#35
Merged
Conversation
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.
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.
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.
EC2ProviderOptions.sporedSigningPublicKey(PEM). When set,userdata.tswrites it to/etc/spawn/spored-signing-key.pem, downloads<binary>.sig(from the checksum URL), base64→DER, andopenssl dgst -sha256 -verifys it before the atomic install — fail-closed on a missing or invalid signature.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
EC2Providerinto the base64 user-data. Docs (architecture.md) state the trust model (checksum = integrity; signature = authenticity). 248 tests, build green.