Repository navigation
Description
Problem
A --no-public-ip instance has no route to the internet unless its subnet routes 0.0.0.0/0 to a NAT gateway. Today the bootstrap needs the internet in three places:
- The AWS CLI zip (Ubuntu). This is currently served from a regional
spawn-binariesmirror (bootstrap: Ubuntu in a private subnet cannot install the AWS CLI (awscli.amazonaws.com unreachable), so it now fails closed #1494). - The EFA installer (
--efa). It has no mirror, and Publish the pinned EFA installer to the spawn-binaries mirror at release (needs spawn/efa/* on the release role) #1507 is closed in favour of this issue. - Ubuntu
apt-get update/ installs. No mirror can serve these.
A NAT gateway costs about $33/month per AZ before its $0.045/GB data charge. The owner does not want users pushed onto it, and does not want spore.host mirroring third-party artifacts.
The preflight check also refuses a route to a NAT instance that the user runs themselves. pkg/aws/private_network.go counts only a NAT gateway as a way out (around lines 232–238 and defaultRoute).
Design (owner-approved direction, 2026-11-02)
A spore.host-managed egress proxy in the user's own VPC, on the same ownership model as the self-hosted reaper (pkg/reaperdeploy). spore.host creates, tags, upgrades and deletes it, and it lives in the user's account.
- One per VPC, created on demand. The first
--no-public-iplaunch whose bootstrap needs the internet creates one small instance (t4g.nano) in a public subnet of that VPC, using an auto-assigned public IPv4 address rather than an EIP. Later launches in that VPC reuse it. - A forward HTTPS proxy, not NAT. There are no route table changes, so other instances in the subnet get no egress. The member bootstrap sets
https_proxyandhttp_proxyonly for its own downloads (curl, apt). The proxy:- accepts connections only from spawn's instance security groups and has no inbound internet ports;
- allows CONNECT only to the destinations spawn needs:
efa-installer.amazonaws.com,awscli.amazonaws.com, and the regional Ubuntu archive mirrors. The list is derived from code, not hand-kept.
- Configurable idle expiry, relaunched on demand (owner decision). The proxy's spored deletes it, and its SG, after an idle period with no proxied traffic. The period is configurable, with a default (proposed: 14 days). If a later launch needs the proxy again, it is simply recreated. TTL always terminates, and the reaper is the backstop.
- Lifecycle commands:
spawn egress-proxy status | delete | upgrade.deleteis the named deleter, so nothing outlives an explicit delete or the idle expiry. - Patching. Unattended OS security updates, with a reboot in a maintenance window.
- Version skew. Each launch that uses the proxy compares the proxy's spawn version with its own. If the proxy is older, the launch replaces it, which is cheap at this size. This avoids the "Lambdas never upgrade" problem.
- Opt-in vs default. Some users choose private subnets for compliance reasons, so creating a path to the internet must be visible. Proposal: the preflight says what needs the internet and offers
--bootstrap-egress proxy. A config default lets a user opt in once.
Rough cost: about $3/month for the instance plus about $3.60/month for its public IPv4, so roughly $6–7/month per VPC while it exists. It costs nothing once it has expired.
Limits
- The VPC needs a public subnet with an internet gateway. A fully isolated VPC cannot use any proxy. The preflight must detect this and say so.
- One proxy per VPC. That makes it a single AZ, so a proxy AZ outage blocks bootstraps that need it. That is acceptable for a bootstrap-time dependency, and is noted rather than solved.
Sub-tasks
- Preflight: count a
0.0.0.0/0route to a NAT instance or ENI as a way out, and report the proxy option when there is none. - Proxy: AMI/user data for the proxy (AL2023 arm64), with the allowlist derived from code and spored with the idle-expiry policy.
- Launch: find-or-create in the launch path (CLI and sweep orchestrator), with a version check and replacement when skewed.
- Bootstrap: member bootstrap proxy env, scoped to spawn's own fetches.
- CLI:
spawn egress-proxy status|delete|upgrade. The reaper must cover proxy instances. - Live test: a no-NAT VPC, Ubuntu
--mpi --efa2-node, plus AL2023; verify idle expiry and relaunch. - Mirror retirement: once this ships, retire the AWS CLI regional mirror (bootstrap: Ubuntu in a private subnet cannot install the AWS CLI (awscli.amazonaws.com unreachable), so it now fails closed #1494), meaning the release step, the
AWSCLIMirrorrelease-role policy and the bucket objects, so one mechanism covers everything.
Considered and rejected
- A temporary NAT instance plus a route: it changes a shared route table, gives egress to everything in the subnet, conflicts with existing default routes, and leaves the most damage if teardown fails.
- A spore.host-hosted proxy via PrivateLink: every user pays for an interface endpoint (about $7/month per AZ plus data), spore.host would run a shared egress service, and it needs a cross-account allowlist per user account.
- Mirroring: the owner prefers not to, and it cannot cover apt.
Activity
scttfrdmn commentedon Nov 3, 2026
Owner decision (2026-11-02): the proxy is opt-in. spawn never creates it implicitly.
--bootstrap-egress proxy, or set a config default once.scttfrdmn commentedon Nov 3, 2026
Build plan for v0.157.0
Phases in order. Each one is a PR, and each PR that touches user data gets a live run with a CLI built from its branch before it merges.
ec2:DescribeInstancesonly, so users need no new IAM. A route to an instance counts only if the instance is running, has source/dest check off, has a public IPv4, and sits in a subnet whose default route is an IGW. Otherwise the launch is refused with the exact reason.spored egress-proxy, a small Go forward proxy.Why spored:
It must handle two kinds of traffic:
CONNECT(EFA installer, AWS CLI);GETforwarding, because Ubuntu's EC2 apt mirrors (*.ec2.archive.ubuntu.com) arehttp://by default.The host allowlist applies to both.
Network access: SG ingress only from spawn's instance SGs on the proxy port, and no other ingress.
spawn:egress-proxy=<vpc>), plus the spawn signing-key authenticity tag (Implement spore.host authenticity key: signed spore tag that all spore tools verify before touching an instance #76), so spore tools only reuse a proxy they can prove spawn made.--bootstrap-egress proxyor the config keybootstrap_egress: proxy. Without either, the launch keeps refusing.--egress-proxy-idle, with a 14-day default.http_proxy,https_proxyandno_proxy(169.254.169.254,.amazonaws.comendpoints that have VPC endpoints, and the VPC CIDR) only around spawn's own fetches. That covers curl, apt (Acquire::http::Proxy) and the EFA installer's internal apt/dnf. The user's job is never proxied implicitly.spawn egress-proxy status | delete | upgrade. Also: reaper coverage, and the docs and IAM table.--mpi --efawith 2 nodes, plus AL2023. Then shorten the idle period to check that expiry deletes the instance and SG, and that the next launch relaunches the proxy.AWSCLIMirrorrelease-role policy, and the bucket objects.feat(no-public-ip): count a working NAT instance as a way out (#1515) (…
scttfrdmn commentedon Nov 3, 2026
Phase 1 is merged: #1516 (
64bc8e5c). The--no-public-ippreflight now accepts a working NAT instance, usingec2:DescribeInstancesonly, so users need no new IAM.It hasn't run against real AWS yet. The phase 6 live test covers it. Phase 2, the spored egress proxy, is in progress.
feat(spored): egress-proxy mode with allowlisted forward proxy (#1515 …
feat(spored): egress-proxy mode — allowlisted forward proxy with idle…
scttfrdmn commentedon Nov 3, 2026
Phase 2 is merged: #1517 (
2c0abab9). It adds thespored egress-proxysubcommand, with a standard-library forward proxy inpkg/egressproxy.egressproxy.Allowlist, where a wildcard matches exactly one label. Tests fail if the EFA or AWS CLI origins drift off it.Next is phase 3: find-or-create, the opt-in flag and config, and the security group.
scttfrdmn commentedon Nov 3, 2026
Owner decision (2026-11-03): the proxy rotates under the reaper's ceiling.
The reaper force-terminates any spawn instance older than
REAPER_MAX_AGE. That's 168h live, measured from launch time, and it has no tag exemption by design. So a proxy can't live past it, and the earlier 14-day idle default is withdrawn.pkg/ttlgates on. Itsspawn:ttl-deadlineis launch time plus max life, so the reaper backstop covers it with no exemption.--idledefault changes from 336h.feat(launch): --bootstrap-egress / --egress-proxy-idle opt-in, find-o…
30 remaining items
scttfrdmn commentedon Nov 5, 2026
Phase 7 merged: #1529 (
fd421346). It retires both the AWS CLI mirror and the EFA installer mirror in code. Live results are on #1529.Live step 1 is done (2026-11-04): I removed the inline policy
AWSCLIMirrorfromGitHubActions-spore-host-release(966362334030). Before deleting it, I confirmed main's release workflow no longer writesspawn/awscli/; only the origin-verify step remains.AWSCLIMirror,SpawnBinariesS3Uploadandspored-signing-kms-signbefore;SpawnBinariesS3Uploadandspored-signing-kms-signafter. Both remaining policies are byte-identical to the snapshot. Attached policies: none, unchanged.s3:PutObjectonspawn-binaries-us-east-1/spawn/awscli/*: implicitDenys3:DeleteObjectonspawn/awscli/*: implicitDenys3:ListBucketwith prefixspawn/awscli/: implicitDenys3:PutObjectonspawn/current/spored-linux-arm64: allowed, so the normal release upload is unaffected.{"Version":"2012-10-17","Statement":[{"Sid":"MirrorObjects","Effect":"Allow","Action":["s3:PutObject","s3:DeleteObject"],"Resource":"arn:aws:s3:::spawn-binaries-*/spawn/awscli/*"},{"Sid":"ListMirrorPrefix","Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::spawn-binaries-*","Condition":{"StringLike":{"s3:prefix":["spawn/awscli/*","spawn/awscli/"]}}}]}Still to do, after the next release:
spawn/awscli/from the 11spawn-binaries-*buckets. v0.156–v0.158 still try the mirror first.73d1876b…tobaa047b3….scttfrdmn commentedon Nov 5, 2026
Phase 7 is complete. v0.159.0 is released and deployed (record on #1530). The 22 mirror objects under
spawn/awscli/are deleted from all 11 buckets, and theAWSCLIMirrorpolicy was removed earlier. spawn no longer mirrors any third-party artifact.Remaining for #1515 (v0.160.0): sweep and orchestrator support for
--bootstrap-egress proxy.scttfrdmn commentedon Nov 5, 2026
Owner decision (2026-11-05): for detached sweeps, the orchestrator can create the proxy.
--detachsubmit time, the CLI finds or creates a proxy for each distinct (region, VPC) among the members.deploy.Evaluate. If the proxy is gone, or won't be reusable (too close to its deadline, or a version mismatch), the orchestrator creates a new one. This is a non-blocking "ensure proxy" phase that spans re-invocations, because the readiness wait doesn't fit in one step.SpawnSweepCrossAccountRolegains the proxy's actions: RunInstances for the proxy, PassRole onspored-instance-profile, SG create/authorize/revoke, andssm:SendCommand/GetCommandInvocationfor the readiness probe. spawn provisions these, not the user.SpawnSweepCrossAccountRolein 942542972736, so detached-sweep proxy support is live-tested in spore-host-dev (435415984226).Plan:
docs: CHANGELOG, flag help and CLI IAM inventory for sweep egress pro…
feat(launch): --bootstrap-egress proxy on foreground parameter sweeps (…
feat(sweep-orchestrator): ensure the egress proxy before each launch …
feat(launch): --bootstrap-egress proxy on detached parameter sweeps (#…
feat(sweep): record the egress proxies in a stdlib-only package; gran…
docs: CHANGELOG, flag help and golden policy test for detached sweep …
test(sweep-orchestrator): egress_proxies round-trip the sweep record (#…
feat(launch): --bootstrap-egress proxy on detached parameter sweeps; …
scttfrdmn commentedon Nov 6, 2026
All of #1515 is done and live-verified.
egress-proxyCLI, idle expiry and relaunch, and retiring the mirrors.Follow-ups are tracked separately in v0.161.0: #1520, #1521, #1524, #1528, #1532 and #1535.