Repository navigation
feat(runner): A job's localhost is the instance's - #54
Merged
Merged
Conversation
A job's localhost is the instance's, so a port published with docker run -p, and a server the job starts on 127.0.0.1 for docker build --network host, are reachable as on a GitHub-hosted runner. The README says so, and the launch template's metadata comment no longer claims the hop limit keeps job containers off IMDS. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A job's containers share the instance's network, so an instance profile would be reachable from them through IMDS, and a task role reaches them the same way. CODING_STANDARDS.md now requires any such role to be very restricted, and the guard fails until the owner has approved one. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…limit still protects Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…host is the runner's The review round found that the comments said the instance has no credentials (true) but not that user-data is readable from a job's containers, and that only the runner container and containers started with --network host share the host network, not every job container. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…ata service The design spec said the containers a job starts can't reach IMDS. A container started with --network host shares the instance's network, so it can. Widened into #39 by the owner. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…es not Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
sodre
marked this pull request as ready for review
November 20, 2026 07:36
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.
Closes #39
Summary
A job's
localhostis now the instance's. A port a job publishes withdocker run -pis reachable atlocalhost, and a server a job starts on127.0.0.1is reachable fromdocker build --network host, as on a GitHub-hosted runner.For the reviewer: the runner container starts with
--network hostin the instance's start script (functions/cloud-config.js). The metadata service stays on with hop limit 1: the owner chose that over disabling it, so the ticket's disable request is an extra below. A standing rule now says any role a job can reach is very restricted, guarded by a conventions test.Extras for the owner
Disable the metadata service after cloud-init reads the user-data. The ticket's comment asks for it, with a check that nothing reads it after boot. Not built: a launch-template
HttpEndpoint: disabledwould also cut off the user-data the instance boots from, and the owner chose to keep the endpoint on with hop limit 1. No source settles it beyond the owner's decision.docs/superpowers/specs/2026-11-12-ci-runner-design.mdlines 213-214 say job containers can't reach the metadata service. That is stale for containers started with--network host. The file is a dated spec: the owner widened it into The job's localhost is the instance's (host networking) #39, and it is updated in bcdc2a6 and a7c2007.The conventions guard does not see an instance profile passed at launch.
test/conventions.test.jsreads the template, so a launcher change that passes an instance profile to RunInstances or CreateFleet would pass it. No code passes one today. No source settles it beyond CODING_STANDARDS.md, IAM.The design spec's JIT line depends on registration order.
docs/superpowers/specs/2026-11-12-ci-runner-design.mdline 263 says the root-only JIT copy is harmless once the config is spent. A job container on the host network can read user-data from IMDS, and the spec does not cover a read during registration. Not in this PR's diff. No source settles it.The spec does not say that a container joined to the runner's network reaches IMDS. A job can start one with
--network container:<runner>through the socket. The added criterion is met as written. No source settles it.Evidence
--network host.test/cloud-config.test.jsdocker run -pand reaches it atlocalhost, and a server the job starts on127.0.0.1is reachable fromdocker build --network host./tmpand$HOME.README.md, the "What the job gets" paragraphtemplate.yaml, both launch templates: the comment says the hop limit still stops a container on another network, and names what a container on the host network reaches--network hostcan.docs/superpowers/specs/2026-11-12-ci-runner-design.mdlines 212-215, built in bcdc2a6 and a7c2007AssertionError: The input did not match the regular expression / --network host /CODING_STANDARDS.md, IAM)TaskRoleArnadded to the x64 task definition:RunnerTaskDefinition gives a job a role (see CODING_STANDARDS.md, IAM), 1 failingnode --test test/*.test.js: 193 passed, 0 skipped, 0 failed, on653853e.Not run: the live check of criterion 2 (a test job publishing a port and a
docker build --network hostreaching a127.0.0.1server), which needs a launch on the shared stack.Merge Danger
Door: two-way. A revert removes
--network hostfrom the start script and restores the bridge; nothing stored changes.Blast Radius: every job that runs on an EC2 runner: its containers share the instance's network.
The merge changes the template and the start script the launcher renders into each instance's user-data. Merging deploys zae (the template changes); instances launched after the deploy get the new start script, and running instances keep the old one. No flag.
Reviews
Correctness, Standards, Spec and Security: three rounds, 4 findings in round 1 and 1 in round 2, all with outcomes
Correctness, round 1
--network hostshare it. Fixed: the comments and the rule say so.Standards, round 1
Spec, round 1
docs/superpowers/specs/2026-11-12-ci-runner-design.mdis stale. Extra for the owner: see the second extra above.Spec, round 2
Security, rounds 1 to 3
No findings in any round. The
--network hostflag and the user-data exposure add no reach beyond the Docker socket a job already has.Correctness, round 4 (widening)
Spec, round 4 (widening)
--network container:also reaches IMDS, and the spec does not say so. The added criterion is MET as written. Extra for the owner: see the joined-container extra under Extras for the owner.Standards, round 4: no findings.
Security, round 4: no findings.
Tracking
Epic: none
Spec: none
Ticket: #39 The job's localhost is the instance's (host networking)
Flag: none
🤖 Generated with Claude Code