ssh: harden the node's sshd (run_command + OpenSshServerMixin) #50

Closed
opened 2026-11-02 09:07:38 +00:00 by christianmanivong · 0 comments
Owner

netOrk's SSH algorithm fix (NetOrk/netork#1027) is refused for every Proxmox node with the reason "the driver does not manage its SSH server … appliances that write sshd_config themselves".

That reason does not hold: a Proxmox VE node runs Debian's stock OpenSSH and leaves sshd_config to Debian, which includes /etc/ssh/sshd_config.d/*.conf. The driver is API + SSH and already runs shell commands over _node_ssh() as root. What it lacks is the public command channel OpenSshServerMixin needs.

Change:

  • run_command(command, *, privileged=False, timeout=60, stdin=None) -> CommandResult on an exec channel of the node's session (napalm_device_types.channel.run_on_transport). privileged needs nothing more, because the node is logged in as root, as in the rest of the driver. A command that cannot run raises ConnectionException, like _exec_ssh_command (#17).
  • OpenSshServerMixin in the class bases, which gives harden_ssh_server and exempt_from_ssh_penalties.
  • Correct the USES_SSH = False comment. The flag stays, because netOrk reads it as "netOrk does not log in over SSH itself".

Cluster note: removing algorithms also narrows what the other members' root SSH can negotiate (migration, replication). The usual findings (NIST-curve kex, SHA-1 MACs, ECDSA host key) leave curve25519/mlkem, SHA-2 ETM MACs and the RSA/Ed25519 host keys, which PVE members speak.

Priority P2: wanted in netOrk 0.47.0.

netOrk's SSH algorithm fix (NetOrk/netork#1027) is refused for every Proxmox node with the reason "the driver does not manage its SSH server … appliances that write sshd_config themselves". That reason does not hold: a Proxmox VE node runs Debian's stock OpenSSH and leaves `sshd_config` to Debian, which includes `/etc/ssh/sshd_config.d/*.conf`. The driver is API + SSH and already runs shell commands over `_node_ssh()` as root. What it lacks is the public command channel `OpenSshServerMixin` needs. Change: - `run_command(command, *, privileged=False, timeout=60, stdin=None) -> CommandResult` on an exec channel of the node's session (`napalm_device_types.channel.run_on_transport`). `privileged` needs nothing more, because the node is logged in as root, as in the rest of the driver. A command that cannot run raises `ConnectionException`, like `_exec_ssh_command` (#17). - `OpenSshServerMixin` in the class bases, which gives `harden_ssh_server` and `exempt_from_ssh_penalties`. - Correct the `USES_SSH = False` comment. The flag stays, because netOrk reads it as "netOrk does not log in over SSH itself". Cluster note: removing algorithms also narrows what the other members' root SSH can negotiate (migration, replication). The usual findings (NIST-curve kex, SHA-1 MACs, ECDSA host key) leave curve25519/mlkem, SHA-2 ETM MACs and the RSA/Ed25519 host keys, which PVE members speak. Priority P2: wanted in netOrk 0.47.0.
christianmanivong added the
prio
P2
enhancement
labels 2026-11-02 09:07:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-proxmox#50