refactor(ssh_server): split three functions under the standard's line limit (#65) #66

Merged
christianmanivong merged 1 commits from fix/ssh-server-ratchet into main 2026-11-01 07:21:11 +00:00
Owner

Closes #65.

Prio: P2. driver / standard has been red on main since #63, which blocks every PR here, #64 (NetOrk/netork#1811) included.

harden_ssh_server (70 lines), _apply_or_restore (51) and exempt_from_ssh_penalties (81) are now under the 50-line limit. Six parts moved into methods of their own:

  • the reading and planning (_plan_hardening)
  • the check that sshd uses the new lists (_algorithms_ignored)
  • the putting back (_put_back)
  • the session's address (_session_client_address)
  • the reasons to leave the exemption as it is (_penalty_exemption_unchanged)
  • writing the exemption, and the check that sshd uses it (_write_penalty_dropin, _exemption_ignored)

Same behaviour and same tests (978). napalm-standard ratchet is within the baseline, and harden_ssh_server leaves the baseline.

Also green against this branch: napalm-linux (272 tests), napalm-bsd (135), napalm-proxmox (361), napalm-openmediavault (21).

Closes #65. Prio: P2. `driver / standard` has been red on main since #63, which blocks every PR here, #64 (NetOrk/netork#1811) included. `harden_ssh_server` (70 lines), `_apply_or_restore` (51) and `exempt_from_ssh_penalties` (81) are now under the 50-line limit. Six parts moved into methods of their own: - the reading and planning (`_plan_hardening`) - the check that sshd uses the new lists (`_algorithms_ignored`) - the putting back (`_put_back`) - the session's address (`_session_client_address`) - the reasons to leave the exemption as it is (`_penalty_exemption_unchanged`) - writing the exemption, and the check that sshd uses it (`_write_penalty_dropin`, `_exemption_ignored`) Same behaviour and same tests (978). `napalm-standard ratchet` is within the baseline, and `harden_ssh_server` leaves the baseline. Also green against this branch: napalm-linux (272 tests), napalm-bsd (135), napalm-proxmox (361), napalm-openmediavault (21).
christianmanivong added 1 commit 2026-11-01 07:17:27 +00:00
refactor(ssh_server): split three functions under the standard's line limit (#65)
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m18s
driver / test (3.12) (pull_request) Successful in 1m28s
driver / test (3.13) (pull_request) Successful in 1m18s
driver / lowest (pull_request) Successful in 35s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 3m9s
driver / publish (pull_request) Skipped
449a6b13ca
harden_ssh_server (70), _apply_or_restore (51) and exempt_from_ssh_penalties
(81) had grown past the 50-line limit with #63, and `driver / standard` was
red on main. The reading and planning, the putting back, the session's
address, the reasons to leave the exemption and its write move into methods
of their own. Same behaviour, same tests; harden_ssh_server leaves the
baseline.
christianmanivong merged commit 8664accbc4 into main 2026-11-01 07:21:11 +00:00
christianmanivong deleted branch fix/ssh-server-ratchet 2026-11-01 07:21:11 +00:00
Sign in to join this conversation.