Repository navigation
hardening: offer post-quantum hybrid key exchange in sshd - #35
Conversation
99-hardening.conf pinned KexAlgorithms to curve25519 and DH group16 only, so OpenSSH 10 clients warn that the connection is not using a post-quantum key exchange. Put mlkem768x25519-sha256 and sntrup761x25519-sha512@openssh.com ahead of the existing list, keeping the existing algorithms after them. sshd refuses a KexAlgorithms name it does not know, and mlkem needs OpenSSH 9.9 while Ubuntu 24.04 ships 9.6p1, so each PQ algorithm is offered only where `ssh -Q kex` on the box lists it: sntrup761x25519 on the ipfs_nodes boxes, both on indexers-chic1 (Debian 13, OpenSSH 10.0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@claude review opus |
Claude reviewThis change looks correct and is safe to merge. It only adds algorithms: the three classical No issues found. claude-opus-5-5 at high effort · requested by TakGN · re-run with |
Why
Operators on OpenSSH 10 get
connection is not using a post-quantum key exchange algorithmwhen they ssh to the boxes. The cause is the config:roles/hardeningwrites/etc/ssh/sshd_config.d/99-hardening.confwithKexAlgorithmspinned tocurve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512, which has no post-quantum hybrid in it.What changes
Only
KexAlgorithms. The post-quantum hybrids come first and the existing three stay after them, so no current client loses access. Ciphers, MACs and everything else are unchanged.hardening_pq_kex_algorithms:mlkem768x25519-sha256, thensntrup761x25519-sha512@openssh.com.mlkem768x25519-sha256needs OpenSSH 9.9. Ubuntu 24.04 (the ipfs_nodes boxes) ships OpenSSH 9.6p1 (1:9.6p1-3ubuntu13.20in noble-updates). So a new read-only task runsssh -Q kexon the box, and only the PQ algorithms that list contains go into the config.validate: sshd -tstill guards the file before it is written.What each box ends up offering:
ipfs_nodes)sntrup761x25519-sha512@openssh.com(enough to stop the warning)indexers)mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.cominfra_boxes)cve.ymlruns onlytasks_from: cve_2026_98432, nevermain.ymlThe SSH client picks the first algorithm in its list that the server supports, so an OpenSSH 10 client gets the PQ hybrid as soon as the server offers one.
mlkem on the Ubuntu boxes needs OpenSSH 9.9+, which means a release upgrade to Ubuntu 26.04 LTS (OpenSSH 10.2p1). This PR does not do that. Once a box runs a newer OpenSSH,
ssh -Q kexlists mlkem and the nextsite.ymlrun adds it with no further change.Rollout: read before approving
site.ymlapplies from CI. A merge gets a dry run on the run's summary page. The real run waits until a required reviewer approves it in theproductionenvironment. It then rolls one box at a time (production_rollout) and stops at the first box that fails or loses admin SSH access.sshd -tbefore writing, then reloads sshd and proves a fresh SSH login before it moves to the next box. Read the dry run's99-hardening.confdiff for each box before approving: the only line that should change isKexAlgorithms.AGENTS.md("Break-glass access"). The break-glass key is in 1Password, Compass vault, item ID4ghgjny7l4rawld4spedu7mxz4. Load it into a throwawayssh-agentand ssh asipni. The last resort is the provider's KVM console withvault_console_password. Fix the problem through the repo, not by hand.Checks
python3 -m yamllint .: cleanpython3 -m ansiblelint:Passed: 0 failure(s), 0 warning(s) ... 'production'ansible-playbook --syntax-checkon site, routing, bootstrap, content, k3s-upgrade, platform, cve: all okssh -Q kexlist (both PQ algorithms) and against a 9.6-like list (sntrup only).Not run against the boxes: this PR has had no
site.ymldry run or apply. That happens in CI after merge.🤖 Generated with Claude Code