Repository navigation
Description
Summary
`spawn upgrade-spored` (#234) downloads from `s3://spawn-binaries-${REGION}/spawn/versions/${VERSION}/spored-linux-${ARCH}`, falling back to the us-east-1 bucket at the same path if the regional one 404s. This versioned path is publicly readable in only 7 of the 11 regional buckets — the other 4, including us-east-1 (the universal fallback every other region relies on), return 403 for every object under that path.
Reproduced live end-to-end today: launched a disposable `t3.micro` in us-east-1, ran `spawn upgrade-spored --version 0.100.0 --allow-downgrade`:
Upgrade spored on i-0defd5431f3e47484: v0.100.1 → v0.100.0
ℹ️ upgrading spored over SSM (this stops + restarts the agent)...
upgrade failed (Failed):
Regional bucket missing v0.100.0; trying us-east-1...
curl: (22) The requested URL returned error: 403
Failed to download spored v0.100.0 (spored-linux-amd64)
(Instance terminated immediately after, no leak.)
Root cause
Each regional `spawn-binaries-*` bucket has its own `PublicReadForBinaries`/`PublicReadGetObject` bucket policy, and they're not consistent:
| Region | Policy Resource | Versioned path (`spawn/versions/.../spored-linux-amd64`) matches? |
|---|---|---|
| us-east-1 | `arn:aws:s3:::spawn-binaries-us-east-1/spored-*` | No — confirmed `403` via direct `curl -I` |
| eu-west-2 | `.../spored-*` | No |
| ap-southeast-1 | `.../spored-*` | No |
| ap-northeast-1 | `.../spored-*` | No |
| us-east-2 | `.../*` | Yes — confirmed `200` |
| us-west-1 | `.../*` | Yes |
| us-west-2 | `.../*` | Yes |
| ca-central-1 | `.../*` | Yes |
| eu-west-1 | `.../*` | Yes |
| eu-central-1 | `.../*` | Yes |
| ap-southeast-2 | `.../*` | Yes |
The `spored-*` pattern is a bucket-root prefix match — it covers the un-versioned "latest" objects (`s3://bucket/spored-linux-amd64`, used by the normal bootstrap install path) but NOT anything under the `spawn/` prefix, which is where every versioned object lives (`spawn/spored-linux-amd64`, `spawn/versions/${V}/spored-linux-amd64`, etc. — see `.github/workflows/release.yaml`'s `emit_copies`). Confirmed directly:
$ curl -sI https://spawn-binaries-us-east-1.s3.amazonaws.com/spawn/versions/0.100.1/spored-linux-amd64
HTTP/1.1 403 Forbidden
$ curl -sI https://spawn-binaries-us-east-1.s3.amazonaws.com/spored-linux-amd64 # un-versioned, bucket-root
HTTP/1.1 200 OK
$ curl -sI https://spawn-binaries-us-east-2.s3.amazonaws.com/spawn/versions/0.100.1/spored-linux-amd64
HTTP/1.1 200 OK
Same result for the `.sha256` checksum object at the versioned path (403 in us-east-1, 200 in us-east-2) — so even the checksum-verification step of the upgrade script can't succeed there.
Impact
- Every instance in the 4 narrow-policy regions (us-east-1, eu-west-2, ap-southeast-1, ap-northeast-1) can never `upgrade-spored --version X` for any version, and can't even fall back, since the fallback target (us-east-1) is itself broken.
- Every instance in any OTHER region additionally breaks the moment its own regional bucket is missing the requested version (e.g. a version released before that region existed, or a partial-upload edge case) and falls back to the also-broken us-east-1.
- The un-versioned `upgrade-spored` (no `--version`, defaulting to "latest") is unaffected today only by coincidence: `buildSporedUpgradeScript` always builds the versioned URL (`spawn/versions/${TARGET_VERSION}/...`) regardless of whether `--version` was passed explicitly or resolved to "latest" — so this bug hits every `upgrade-spored` invocation whose target version happens to require the us-east-1 fallback, not just explicit downgrades.
Suggested fix
Make all 11 regional bucket policies consistent — either widen the 4 narrow ones to the same `.../` pattern the other 7 already use, or (tighter, if there's a reason `spawn/` shouldn't be blanket-public) add an explicit `spawn/` statement alongside the existing `spored-` one. Given the un-versioned path already grants `spored-` publicly and the versioned path is the newer (#234) addition, the narrow 4 are almost certainly just stale relative to the `emit_copies` upload layout, not an intentional restriction — worth checking whether these 4 buckets predate #234 (spored self-upgrade) landing, since the other 7 look like they were provisioned or fixed afterward.
Also worth a smoke test in CI or a post-release check: hit `https://spawn-binaries-.s3.amazonaws.com/spawn/versions//spored-linux-amd64.sha256` for all 11 regions after each release and fail loud if any 403s, so a drifted bucket policy doesn't silently sit broken again.
Environment
Live-reproduced 2026-08-18: spawn CLI v0.100.1, target instance us-east-1 t3.micro, `spawn upgrade-spored --version 0.100.0 --allow-downgrade --yes`.
Activity
scttfrdmn commentedon Aug 18, 2026
Fixed directly in infra (no code change needed — this was purely a bucket-policy gap).
Root cause, refined: the 4 narrow buckets (us-east-1, eu-west-2, ap-southeast-1, ap-northeast-1) already correctly scoped public read to
spored-*and excludedmpi-keys/*from public access via a separate cross-account statement — they just never grew aspawn/*clause when the versioned-upload layout (spawn/versions/<v>/...) was introduced. The other 7 buckets used a blanket/*public-read, which incidentally covered the versioned path but would ALSO have madempi-keys/*public the moment anything was ever written there (nothing has been yet, so no real exposure occurred, but the policy was latently wrong).Fix applied to all 11 regional
spawn-binaries-*buckets — same policy shape everywhere now:PublicReadForBinaries: publics3:GetObjectonspored-*ANDspawn/*(covers both the un-versioned "latest" path and the versionedspawn/versions/<v>/...path)AllowCrossAccountMPIKeys: privateGetObject+PutObjectonmpi-keys/*, scoped toarn:aws:iam::435415984226:role/spored-instance-role(already existed on 4 buckets; extended to the other 7 for consistency — not a new grant, the same statement that was already live)Verified across all 11 regions via direct
curl -I:spawn/versions/0.100.1/spored-linux-amd64+.sha256): 200 everywhere (was 403 in the 4 narrow regions)spored-linux-amd64): still 200 everywhere (unaffected)mpi-keys/*anonymous access: 403 everywhere (newly closed in the 7 previously-wide-open buckets)End-to-end live verification: launched a disposable
t3.microin us-east-1 (the region that was broken), ranspawn upgrade-spored <id> --version 0.100.0 --allow-downgrade— succeeded (checksum verified, swapped, health-checked). Upgraded back to v0.100.1 — also succeeded. Instance terminated immediately after, no leak.