feat(ssh): harden the node's sshd through a run_command channel (#50) #51

Merged
christianmanivong merged 3 commits from feat/ssh-hardening into main 2026-11-02 11:39:45 +00:00
Owner

Closes #50. netOrk side: NetOrk/netork#1888 (the capability appears with the napalm-proxmox pin bump of the 0.47.0 sweep, no netOrk code).

  • run_command(command, *, privileged=False, timeout=60, stdin=None) -> CommandResult on an exec channel of _node_ssh() via napalm_device_types.channel.run_on_transport. privileged needs nothing more because the node is logged in as root. Errors and timeouts raise ConnectionException, as _exec_ssh_command does.
  • OpenSshServerMixin in the bases: harden_ssh_server, exempt_from_ssh_penalties.
  • USES_SSH comment corrected; the flag itself is unchanged (netOrk reads it as "netOrk does not log in over SSH itself").

Tested: 6 new tests (red before, green after), full suite 512 passed, ruff, format, mypy, napalm-standard check + ratchet, bandit. Read-only live check on a PVE 9.2 cluster node: run_command returned stdout, stderr and exit code separately as root, and get_ssh_server_algorithms() read sshd -T through it. Nothing was changed on the host.

Closes #50. netOrk side: NetOrk/netork#1888 (the capability appears with the napalm-proxmox pin bump of the 0.47.0 sweep, no netOrk code). - `run_command(command, *, privileged=False, timeout=60, stdin=None) -> CommandResult` on an exec channel of `_node_ssh()` via `napalm_device_types.channel.run_on_transport`. `privileged` needs nothing more because the node is logged in as root. Errors and timeouts raise `ConnectionException`, as `_exec_ssh_command` does. - `OpenSshServerMixin` in the bases: `harden_ssh_server`, `exempt_from_ssh_penalties`. - `USES_SSH` comment corrected; the flag itself is unchanged (netOrk reads it as "netOrk does not log in over SSH itself"). Tested: 6 new tests (red before, green after), full suite 512 passed, ruff, format, mypy, `napalm-standard check` + `ratchet`, bandit. Read-only live check on a PVE 9.2 cluster node: `run_command` returned stdout, stderr and exit code separately as root, and `get_ssh_server_algorithms()` read `sshd -T` through it. Nothing was changed on the host.
christianmanivong added 1 commit 2026-11-02 09:09:38 +00:00
feat(ssh): harden the node's sshd through a run_command channel (#50)
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m13s
driver / test (3.12) (pull_request) Successful in 1m23s
driver / lowest (pull_request) Successful in 44s
driver / test (3.13) (pull_request) Successful in 1m23s
driver / build (pull_request) Successful in 34s
driver / security (pull_request) Successful in 1m13s
CI / driver (pull_request) Successful in 2m55s
driver / publish (pull_request) Skipped
ef1900c32a
A Proxmox node runs Debian's stock OpenSSH, so OpenSshServerMixin works
there as on a plain Linux host. What it needed was run_command: an exec
channel on the node's SSH session, via napalm-device-types'
run_on_transport. The USES_SSH comment said there was no SSH session;
it now says what the flag means to netOrk.
christianmanivong added 1 commit 2026-11-02 11:02:26 +00:00
Merge remote-tracking branch 'origin/main' into feat/ssh-hardening
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m22s
driver / test (3.12) (pull_request) Successful in 1m27s
driver / test (3.13) (pull_request) Successful in 1m12s
driver / lowest (pull_request) Successful in 39s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 3m7s
driver / publish (pull_request) Skipped
d4ed73c52b
christianmanivong added 1 commit 2026-11-02 11:07:41 +00:00
Merge remote-tracking branch 'origin/main' into feat/ssh-hardening
driver / standard (pull_request) Successful in 20s
driver / lint (pull_request) Successful in 17s
driver / test (3.12) (pull_request) Successful in 1m25s
driver / types (pull_request) Successful in 1m27s
driver / test (3.13) (pull_request) Successful in 1m11s
driver / lowest (pull_request) Successful in 35s
driver / build (pull_request) Successful in 35s
driver / security (pull_request) Successful in 1m16s
CI / driver (pull_request) Successful in 3m4s
driver / publish (pull_request) Skipped
8521cff935
christianmanivong merged commit a4c220d2e3 into main 2026-11-02 11:39:45 +00:00
christianmanivong deleted branch feat/ssh-hardening 2026-11-02 11:39:45 +00:00
Sign in to join this conversation.