Repository navigation
fix(template): serve the nginx 443 vhost over HTTP/1.1 only - #447
Conversation
The 443 server block rendered by install-nginx.yaml is a reverse proxy to a loopback service and does not need HTTP/2. Drop http2 from both 443 listen lines to remove the HTTP/2 attack surface. Apply the same change to the three template directories that carry the playbook. Rewrite the playbook comments so they describe what the tasks do: the caller-supplied or self-signed origin cert, the origin_cert_b64 / origin_key_b64 variables, and the self-signed fallback that keys on the cert variable. Add a test that fails while the 443 listen lines enable HTTP/2. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Taking the cyan (final) review seat for this PR, round 1. Reading the diff against the base and the three template versions now; the verdict will follow as a formal review on the target commit. actor: seat=cyan · model=claude-opus-5-5 · host=mac.home · session=3fe1844d · agent=a9f45e317024bb023 |
|
Infrastructure gate (auron) is starting the round 1 review of this PR at the head below. The review reads the diff and the playbooks in the three template version directories, and takes build and test results from the CI check runs on this head. actor: seat=auron · model=claude-opus-5-5 · host=mac.home · session=3fe1844d · agent=a083526e469aea74e |
KishiTheMechanic
left a comment
There was a problem hiding this comment.
cyan review, round 1 (final seat; R2 with the infrastructure seat in parallel)
PASS on cf16008b4576cfe80d42fd9ff4b057830fcfef58 (base 8d6a5f04e2b860912ad78e045bc0a6ed0a29b8d8). No blocking findings.
Scope read
- The diff from base to Target touches 4 files: the three copies of
ansible/cmn/software/install-nginx.yaml(undertemplate/2026.10.18.1610,template/2026.10.19.0750andtemplate/2026.10.19.1053) and the newtemplate/2026.10.19.1053/tests/rpc_geyser/test_install_nginx.py. Nothing outside those files changed: no version bump and no workflow change. - I also read the whole playbook at Target, its CLI caller
cli/src/install/nginxFlow.ts, the task-name pin incli/test/unit/template_w0_guards.test.ts, and.github/workflows/slv-template-tests.yml.
Requirements
- HTTP/2 is removed from the 443 vhost.
- In task
Render vhost file,listen 443 ssl http2;andlisten [::]:443 ssl http2;becamelisten 443 ssl;andlisten [::]:443 ssl;. The "Legacylisten ... http2form" comment block is gone. - Probe
git grep -I -c -E 'listen[^;]*http2|http2[[:space:]]+on' <sha> -- .found 0 hits at Target (rc=1). The positive control on base found 4 hits in each of the 3 playbook copies. git grep -I -n grpc_pass <Target> -- .found 0 hits.- No other nginx config in the tree enables HTTP/2.
- In task
- The three copies stay identical.
git rev-parse <Target>:template/<v>/ansible/cmn/software/install-nginx.yamlreturns the same blob82069c0bdcc091cbf5297fd2b048330df397a37cfor all three version dirs.- At base the three copies were also identical:
git diff --statbetween the copies is empty at both commits. git ls-tree -r --name-only <Target> | grep -c install-nginx.yamlreturns 3, so no copy was missed.
- The comments now match the tasks. I checked each rewritten sentence against its task:
- "Each is written verbatim when its own variable is non-empty" matches
when: origin_cert_b64 | length > 0onWrite caller-supplied origin certificateandwhen: origin_key_b64 | length > 0onWrite caller-supplied origin private key. - "The self-signed fallback keys on the cert variable alone ... and it also generates the key" matches
Generate self-signed origin cert (fallback), which haswhen: origin_cert_b64 | length == 0,creates: /etc/nginx/ssl/{{ fqdn }}.crtand-keyout /etc/nginx/ssl/{{ fqdn }}.key. - The removed text "When either is empty, we fall back ..." was wrong when the cert is supplied and the key is empty. The new text is right for that case.
- "one on 443 with the cert written above (caller-supplied or self-signed)" matches the 443 block: its
ssl_certificateandssl_certificate_keypaths are the files both branches write. - The new header entries for
origin_cert_b64andorigin_key_b64match thevars:defaults ('').
- "Each is written verbatim when its own variable is non-empty" matches
- Test coverage
- Reach. In
SLV Template Tests, the steprpc_geyser (RPC init, update and gateway playbooks)runspython3 -m unittest discover -s template/latest/tests/rpc_geyser -p 'test_*.py' -v. It fails the step on a skip or onRan 0 tests. At Target,template/latestis a symlink to2026.10.19.1053, and the install step installspython3-yaml, so the new file is discovered and its imports resolve.Path(__file__).resolve().parents[2]is the version dir, so the test reads the2026.10.19.1053playbook. - Firing (derived by reading; this seat did not run it). At base, the
Render vhost fileliteral containslisten 443 ssl http2;. Once split and stripped of;, its tokens containhttp2, soassertNotInfails. - No vacuous pass. The test requires at least one 443
listendirective (assertTrue(listen_443, ...)) and raises if the task is missing.
- Reach. In
Non-regression
- In the 443 block only the two
listenlines and a comment changed.ssl_*, the proxy headers, the timeouts andproxy_passare unchanged, and the port 80 block is byte-identical. - The upstream leg is already HTTP/1.1 (
proxy_http_version 1.1toproxy_pass http://127.0.0.1:{{ upstream_port }}), and the tree has nogrpc_pass. Nothing behind this vhost depends on HTTP/2 from the client. listen 443 ssl;is valid on both nginx 1.24 and 1.25+. The removed comment existed only to explain the inlinehttp2parameter.- No task name changed, so the pin
'ansible/cmn/software/install-nginx.yaml: Write caller-supplied origin private key'incli/test/unit/template_w0_guards.test.tsstill matches. - The edited
Render vhost filecontent adds none of the strings that test's key-writer regex matches (private key|origin_key|wg_private_key_value|PrivateKey), so the test's found list is unchanged. - The CLI caller passes the same variables, and its note "the playbook's self-signed fallback kicks in when they're empty" still holds.
- Added lines contain no line-number references. The only
:<digits>hits are the IPv6[::]:443listen literals.
Other findings
- pre-existing, not blocking (base behaves the same). The playbook header says vhosts from a run with a different
fqdn"are NOT cleaned up automatically", and no task removes theirsites-enabledlink. An older vhost that still haslisten 443 ssl http2;therefore stays loaded beside the new one. nginx applieslistenparameters per address:port, so that older vhost would keep HTTP/2 on :443 until it is removed or re-rendered. This is reasoned from nginx's listen semantics; this seat did not run it.
wording
(none)
CI on Target
gh api repos/ValidatorsDAO/slv/commits/<Target>/check-runs --paginatereturned 37 rows, which equalstotal_count(37). Every row iscompleted, and every conclusion issuccessorskipped(none failed).success:resolve,test,source-materials,package,runtime-qualification,qualification-inputs,build-aarch64-apple-darwin,build-aarch64-unknown-linux-gnu,build-x86_64-unknown-linux-gnu,build-x86_64-apple-darwin,Template tests (ansible-core 2.16),Render matrix,nft -c and netns verdicts,Listen model (Python 3.10),Listen model (Python 3.12).skipped: the remaining 22 rows (publish, attest, the validation-smoke and source-* matrix jobs, and similar).
- The
Template tests (ansible-core 2.16)job log (job 135530540185) containstest_443_vhost_is_http1_only (test_install_nginx.InstallNginxVhostTest.test_443_vhost_is_http1_only) ... ok, followed byRan 168 tests .../OKfor the rpc_geyser step. This confirms the new test reaches CI on the Target. - The CI wait returned
code0 with stategreen, 37 checks, no failing and none pending. Itscopyfield was{"judge":"origin/main","commit":"8ddd7d1867eb7072dc38e4cfa72d86299c8405c0","handedOver":false}.
Unverified
- This seat ran no ansible, nginx, Python or Deno, so
ansible-playbook --syntax-checkwas not run here either. Test results are CI's conclusions on the Target. - Nobody has observed nginx serving HTTP/1.1 only on :443 after a real install from this template (for example, an ALPN probe against a rendered host).
- The per-address:port
http2behaviour behind the pre-existing note above was not run.
actor: seat=cyan · model=claude-opus-5-5 · host=mac.home · session=3fe1844d · agent=a9f45e317024bb023
Gate: cyan
Round: 1
Target: cf16008
Verdict: PASS
Claim: cyan-slv447-r1-798d114e
Effort: xhigh
Wording: 0
KishiTheMechanic
left a comment
There was a problem hiding this comment.
auron (infrastructure) / round 1 / target cf16008
Verdict: PASS — no blocking findings.
Scope read: the diff from base 8d6a5f04e2b860912ad78e045bc0a6ed0a29b8d8 to the target (4 files: install-nginx.yaml in the three template version directories, plus the new template/2026.10.19.1053/tests/rpc_geyser/test_install_nginx.py), the whole playbook at the target, its callers, the template packaging path, and the template tests workflow. I read git objects only. Build and test results come from the CI check runs on this head.
Requirement fulfilment
- HTTP/2 is gone from the 443 server block in all three copies.
git grep -I -E 'listen[^#]*http2|http2 on' <target>returns 0 lines; the same command at base returns 12 (twolistenlines and two comment lines per copy).git grep -E 'listen[[:space:]].*443'returns 6 lines at both base and target: at base all six aressl http2, at the target all six are plainssl. - The three copies are byte-identical at the target.
git rev-parse <target>:template/<dir>/ansible/cmn/software/install-nginx.yamlgives blob82069c0b…for all three dirs; base givesbb414537…for all three. - I checked each rewritten comment against the task it describes, and each one matches.
- "Write caller-supplied origin certificate" runs
when: origin_cert_b64 | length > 0. "Write caller-supplied origin private key" runswhen: origin_key_b64 | length > 0. - "Generate self-signed origin cert (fallback)" runs
when: origin_cert_b64 | length == 0andcreates:the crt file. Itsopenssl reqwrites both-keyoutand-out. - The removed "Flexible SSL mode … plain HTTP on port 80" paragraph contradicted the 443 block and the certificate tasks, which are still there.
- "Write caller-supplied origin certificate" runs
- New test:
- Reach:
slv-template-tests.ymlruns onpull_requestfortemplate/**. Its step "rpc_geyser (RPC init, update and gateway playbooks)" runsunittest discover -s template/latest/tests/rpc_geyser -p 'test_*.py'.template/latestresolves to2026.10.19.1053, and the job installspython3-yaml. The job log of "Template tests (ansible-core 2.16)" on this head showstest_443_vhost_is_http1_only (test_install_nginx.InstallNginxVhostTest.test_443_vhost_is_http1_only) ... ok, followed byRan 168 testsandOKfor that step, so CI runs the new test. - Firing: I derived this and did not re-run it. The base literal
listen 443 ssl http2;splits into tokens that containhttp2, soassertNotIn(H2, tokens, …)fails on base. The before/after output in the PR body is the author's.
- Reach:
Non-regression
- In each playbook, the only change outside comment lines is the two
listenlines. The 13- name:task names are identical at base and target. Thevars, the port 80 block,Validate nginx config(nginx -t) beforeReload nginx, anddiff: falseon "Write caller-supplied origin private key" are all unchanged. - Upstream protocol: both server blocks use
proxy_pass http://127.0.0.1:{{ upstream_port }}withproxy_http_version 1.1at both base and target, so the hop to the loopback service was HTTP/1.1 before and after.git grep -l -E 'grpc_pass|sites-(available|enabled)|proxy_pass' <target>finds no other nginx renderer in the tree, so no HTTP/2-to-upstream path existed for this change to break. The WebSocketUpgrade/Connection "upgrade"headers are unchanged. - The Deno guard "no_log: every copy that writes a private key from its content returns no diff" still names this playbook's key task, and the
testcheck is green on this head.
Blast radius and rollback
- Callers.
git grep 'install-nginx' <target>(stem, repo-wide) finds one runtime caller,cli/src/install/nginxFlow.ts(${templateRoot}/ansible/cmn/software/install-nginx.yaml), plus one Deno test reference and the new Python test.runNginxFlowis called fromslv install nginx(cli/src/install/index.ts) and twice from the onboard flow (cli/src/ai/onboard/onboardAction.ts). - Hosts reached. The runner
cli/lib/runAnsibleLocal.tsinvokesansible-playbook -i localhost, --connection=local, sohosts: allresolves to the single machine the CLI runs on. Each invocation reaches exactly one host, and no--limitassumption is involved. - Shipping path. The template ships as
template.tar.gzof the current version dir only (deno.jsoncreate:template:tar -czf dist/template.tar.gz ./template/2026.10.19.1053). The CLI reads${configRoot}/template/${denoJson.version}(cli/lib/getTemplatePath.ts). The edits to the two older dirs therefore have no shipping path at this target; they keep the tree consistent for future version bumps. - Merge reach.
scripts/release/workflow.ts(resolve) returnsrelease_required: falsewhen the version atbeforeequals the version atafter. This diff does not touch the version, so merging publishes nothing. The change reaches a machine only when a later release ships the template and someone runsslv install nginxor the onboard HTTPS step. - Rollback. Re-running a template that still has the old
listenlines restores them. The task chain is copy, link,nginx -t, then reload, with no deletion and no restart, and it is safe to re-run.
Other checks
- Secrets: no task that handles key material changed, and nothing is echoed or logged.
- Workflows: no
.github/workflows/**diff and no generator or manifest diff. No new workflow, job or gate. - Line-number locators: I probed the added lines for
:<digits>,line <n>andL<n>. The only match is the address:port[::]:443. The stem grep shows that nothing else in the tree refers into this playbook by line.
Non-blocking
- Pre-existing: the playbook header says vhosts rendered for an earlier
fqdnare not cleaned up, andEnable vhostonly adds links. A vhost file that an earlier run rendered for a differentfqdntherefore stays enabled and keepslisten 443 ssl http2;. This diff cannot reach that file and base behaves the same, so it is not blocking here. Fixing it would mean a new deletion task, which has its own blast radius.
CI (check runs on the target)
gh api repos/ValidatorsDAO/slv/commits/<target>/check-runs --paginate: I copied 37 rows, matching total_count 37. All are completed: 15 success and 22 skipped, with no failure, cancellation or pending run.
resolve success
test success
source-materials success
qualification-inputs success
runtime-qualification success
build-x86_64-unknown-linux-gnu success
build-aarch64-unknown-linux-gnu success
build-x86_64-apple-darwin success
build-aarch64-apple-darwin success
package success
Template tests (ansible-core 2.16) success
Render matrix success
nft -c and netns verdicts success
Listen model (Python 3.10) success
Listen model (Python 3.12) success
(22 further jobs: skipped — publish, attest, activation-required, qualification-promotion,
verify-existing, legacy-bootstrap, source-native-diagnostic, the two validation-smoke-* jobs
and the source-* validation jobs)
The CI wait script returned code 0, state green, total 37 and no failing checks. Its copy field is {"judge":"origin/main","commit":"8ddd7d1867eb7072dc38e4cfa72d86299c8405c0","handedOver":false}.
Not verified
- I did not run ansible and did not run
nginx -tagainst a real nginx for the rendered vhost. This was a read-only review, and the--syntax-checkoutput is the author's. The CI template tests run the unit test, not this playbook. - How the edge proxy and clients behave against an origin that offers only HTTP/1.1 over TLS was not measured.
- Hosts with another enabled server block on port 443, whether from earlier runs or the operator's own config, were not measured.
wording
(none)
actor: seat=auron · model=claude-opus-5-5 · host=mac.home · session=3fe1844d · agent=a083526e469aea74e
Gate: auron
Round: 1
Target: cf16008
Verdict: PASS
Claim: auron-slv447-r1-92c5c99e
Effort: xhigh
Wording: 0
What changed
ansible/cmn/software/install-nginx.yaml: the 443 server block now useslisten 443 ssl;andlisten [::]:443 ssl;(HTTP/2 removed). The same change is applied to the three template directories that carry the playbook (2026.10.18.1610,2026.10.19.0750,2026.10.19.1053), which end byte-identical.origin_cert_b64/origin_key_b64) or self-signed origin cert, the two variables added to the header list, and the self-signed fallback, which keys onorigin_cert_b64.template/2026.10.19.1053/tests/rpc_geyser/test_install_nginx.py, picked up by the existingrpc_geyserstep of the template tests workflow.No task was renamed and no non-comment line changed other than the two
listen 443lines.Why
The 443 vhost is a reverse proxy to a loopback service and does not need HTTP/2. Removing it removes the HTTP/2 attack surface.
How it was verified
The
listenlines carry no Jinja, so the YAML literal is what ansible renders; no ansible run was needed.Test, run against the playbook before the change (fails on the
http2token):Same command after the change:
Syntax check after the change:
actor: seat=backend-l3-pokemon-wanriky · model=claude-sonnet-5-5 · host=mac.home · session=3fe1844d · agent=a42714c4076ab3e65
🤖 Generated with Claude Code