Repository navigation
fix(#42): verify the emulator's certificate in Compose and Vagrant - #136
Open
fullsend-ai-coder[bot] wants to merge 1 commit into
Open
fullsend-ai-coder[bot] wants to merge 1 commit into
fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
The shipped runners still set RUNNER_TLS_VERIFY=false because neither could verify Caddy's certificate: the addresses they used are not names the certificate carries, and neither had Caddy's root CA. Compose: the actions-runner uses https://ghemu.local, a network alias of github-emulator. A new supervisord program (scripts/export-caddy-root-ca.sh) copies Caddy's root certificate, not its key, to the shared caddy_root_ca volume when CADDY_ROOT_CA_EXPORT is set. The runner's entrypoint waits for it, adds it to the OS bundle and points SSL_CERT_FILE there, so git in checkout steps trusts it too. A caddy_data volume keeps the CA across container recreation, so an emulator rebuild does not strand a running runner on an old CA. Vagrant: the runner defaults to https://ghemu.local (already in its /etc/hosts). The old s_client step fetched the leaf certificate from the IP without SNI, before the emulator was even deployed, so it never worked; it is replaced by a "ghemu-ca" provisioning step. New make vm-runner-ca (run by vm-deploy) copies root.crt from the server to .vagrant/ghemu-root-ca.crt and re-runs that step, which installs it and restarts the runner. RUNNER_TLS_VERIFY now defaults to true in both and can still be overridden. Tests: tests/test_runner_tls_deployments.py checks the wiring and runs the export script; 5 of its 7 tests fail on the old configuration. Docs and ledger updated. Note: not run end to end. The sandbox has no Docker, Podman, Vagrant, Ruby or network access, so a job has not been run in either setup. pre-commit could not fetch hook repos (TLS error); its hooks were run directly at their pinned versions (pre-commit-hooks 6.0.0, ruff 0.17.3, shellcheck 0.11.0.1) and passed; gitleaks via scan-secrets. Pre-existing unrelated failures: test_runner_shutdown and test_security_headers (frontend dist not built). Closes #42 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 2:55 PM UTC · Completed 3:04 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.84 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk change that closely aligns with the linked issue and provides opt-out rollback safety via RUNNER_TLS_VERIFY, despite touching a protected script path and Makefile. |
ReviewFindingsMedium
Labels: PR changes Docker Compose/container setup and updates guides. |
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.
Summary
The Compose and Vagrant Python runners now verify the emulator's TLS certificate by default. Both used to ship
RUNNER_TLS_VERIFY=false.Compose (
docker-compose.yml,supervisord.conf,scripts/export-caddy-root-ca.sh)actions-runnernow connects tohttps://ghemu.local.ghemu.localis a new network alias ofgithub-emulatorand the name Caddy's certificate carries. Since Compose actions-runner cannot register: Caddy has no certificate for github-emulator #81 the runner had used plainhttp://github-emulator:8000.scripts/export-caddy-root-ca.sh, waits for Caddy's local CA and copies onlyroot.crt(notroot.key) to$CADDY_ROOT_CA_EXPORT. If the variable is unset it does nothing, so other deployments of the image are unaffected. Compose sets it to a path on the sharedcaddy_root_cavolume.update-ca-certificates, then startsrunner.py.SSL_CERT_FILEpoints at the OS bundle, which keeps the public roots. git in checkout steps uses the same bundle, and so dogh/curlin job steps.caddy_datavolume keeps Caddy's CA when the emulator container is recreated (for example bydocker compose up -d --build). Otherwise a running runner would be left trusting the old CA.make upstill wipes volumes, so the runner it recreates picks up the new CA.Vagrant (
Vagrantfile,Makefile)https://ghemu.local, which its/etc/hostsalready maps to the server VM.openssl s_clientagainst the IP without SNI and saved the leaf certificate, and it ran before the emulator was deployed, so it never worked. It is replaced by aghemu-cashell provisioner, which installs.vagrant/ghemu-root-ca.crtinto the OS store and restartsactions-runner.make vm-runner-catarget, also run at the end ofvm-deploy. It readsroot.crtfrom the server VM's emulator container and runsvagrant provision runner --provision-with ghemu-ca.RUNNER_TLS_VERIFYnow defaults totruein both setups and can still be overridden from the environment.Docs:
docs/guides/actions-runners.mdanddocs/guides/api-usage.mdare updated, and the ledger notes are indocs/tasks/pending/actions-runner-compose-bootstrap.mdanddocs/bugs/fixed/python-runner-skips-tls-verification.md.Testing
tests/test_runner_tls_deployments.pyhas 7 tests. They statically check the Compose and Vagrant wiring (URL, verify default, alias, shared volume, entrypoint, supervisord program, and that the Makefile and Vagrantfile agree on the CA path). They also run the export script against a fake Caddy data directory and confirm onlyroot.crtis copied, with mode 644. On the old configuration, 5 of the 7 fail.tests/test_compose_runner_urls.pyandtests/actions/test_runner_tls_verify.pypass.test_runner_shutdown::test_a_shutdown_signal_fails_the_running_step_and_stops_its_processesfails on unmodifiedmaintoo, andtest_security_headersfails because the frontenddistisn't built in the sandbox.pre-commitcouldn't fetch its hook repos (TLS error). Its hooks were run directly at their pinned versions (pre-commit-hooks 6.0.0, ruff 0.17.3, shellcheck 0.11.0.1) and passed. gitleaks ran viascan-secrets.Caveats: manual verification needed
The issue asks for a job to run end to end in each setup. That has not been done here. The sandbox has no Docker, Podman, Vagrant, Ruby or outbound network, so the Vagrantfile's Ruby was not parsed and neither stack was started. Before merging, please check:
make up, thenmake actions-runner-env, thendocker compose up -d actions-runner. Check the runner registers with no TLS errors, then push the hello workflow from the guide and confirm it succeeds, including a checkout step.make vm-upthenmake vm-deploy(which now ends withvm-runner-ca). Checkjournalctl -u actions-runneron the runner VM shows a successful registration and a job.Other notes:
make vm-starton its own, runmake vm-runner-caagain:vm-startwipes volumes, so Caddy creates a new CA.RUNNER_TYPE=realin Vagrant, the CA is installed but the upstream runner's systemd service isn't restarted.🤖 Generated with Claude Code
Closes #42
Post-script verification
agent/42-verify-runner-tls)0454bace16539f60483343fc2079d8b7d7a6ebc7..HEAD)