Repository navigation
fix: spored installs in all regions + robust sig-aware fallback (#440) - #441
Merged
Merged
Conversation
The release workflow published spored to 4 US spawn-binaries-* buckets only, relying on a bootstrap fallback to us-east-1 for the other 7 regions. But those regional buckets held a STALE, UNSIGNED binary from a prior release — so the bootstrap's regional fetch succeeded (fallback never fired) and, with SPORED_SIG_VERIFY=1 (the default), the missing .sig made the install fail closed (exit 1) in ca-central-1/eu-*/ap-*. Instances there came up with no spored: no TTL/idle enforcement, no DNS. Two-part fix: 1. release.yaml: publish the signed binary to all 11 regions spawn operates in (matching the ttl-reaper's defaultRegions), so no regional bucket ever serves a stale binary. 2. bootstrap.go: probe a source's .sig BEFORE committing to it when verifying, so a stale/unsigned regional bucket falls through to the us-east-1 fallback instead of downloading-then-hard-failing. Iterate candidates (regional prefixed/legacy → us-east-1 prefixed/legacy). Tests: sig-aware-fallback structure + `bash -n` syntax check of the generated bootstrap. Note: pkg/launcher/bootstrap.go is the only download path that does sig verification (hence the hard-fail); the other paths (install-spored.sh/ .ps1, cmd/app.go upgrade, pipeline-orchestrator) would only serve a stale binary, which part 1 (all-region publish) fixes for all of them.
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.
Fixes #440.
The bug (HIGH — found verifying the v0.93.0 release downstream)
spored install fails closed (
exit 1) in the 7 non-US regions, so instances there run with no lifecycle daemon — no TTL/idle enforcement, no DNS.Two facts interact:
SPORED_SIG_VERIFY=1(the default since [HIGH] spored bootstrap fails closed in the 7 non-US regions — stale regional buckets have no .sig, and the us-east-1 fallback never triggers #440), the missing.sigat the regional bucket trips the fail-closed check →exit 1.Fix (two parts)
release.yaml— publish the signed binary to all 11 regions spawn operates in (matchingdefaultRegionsin the ttl-reaper), so no regional bucket serves a stale binary. Backfills the 7 stale buckets on the next release.bootstrap.go— refactor the download to iterate candidate sources (regional prefixed/legacy → us-east-1 prefixed/legacy) and, when verifying, HEAD-probe the.sigbefore committing to a source. A stale/unsigned regional bucket now falls through to us-east-1 instead of downloading-then-hard-failing. Robust to a half-populated bucket, not just a missing one.Scope note
pkg/launcher/bootstrap.gois the only download path that does signature verification (hence the hard-fail). The others (install-spored.sh/.ps1,cmd/app.goupgrade line,pipeline-orchestrator) would only serve a stale binary, not hard-fail — and part 1 (all-region publish) fixes staleness for all of them at the source, so no per-path shell refactor is needed.Tests
TestBuildLinuxBootstrap_SigAwareFallback— asserts the candidate list + up-front.sigHEAD-probe + the old brittle logic is gone.TestBuildLinuxBootstrap_ValidBash—bash -nsyntax-checks the generated script so a shell error in the refactor can't ship.pkg/launchersuite green.Rollout
Merging fixes it for future releases. To repair the currently-stale buckets now, either cut a release (re-runs the all-region upload) or backfill v0.93.0's signed spored into the 7 non-US buckets (interim mitigation in the issue: delete the stale objects so the existing fallback kicks in until then). Both are infra-account actions.