feat: open() waits out sshd's per-source penalty (NetOrk/netork#1800) #51

Merged
christianmanivong merged 2 commits from feat/ssh-penalties-1800 into main 2026-10-31 23:36:46 +00:00
Owner

For NetOrk/netork#1800. Depends on NAPALM/napalm-device-types#63: CI installs device-types from main, so this goes green once #63 is merged.

OpenSSH 9.8+ (PerSourcePenalties) closes every connection from a source it has just penalised, before its banner, for seconds to minutes. A security scanner's probes earn the managing client exactly that.

  • open() wraps netmiko's ConnectHandler in device-types' retry_refused. A connection turned away before the banner is tried again after 1, 3, 7 and 15 s, 26 s in all. Everything else fails as before, including a host-key mismatch (the existing test is unchanged).
  • New test: ConnectHandler raises netmiko's wrapped "Error reading SSH protocol banner" twice, then connects.
  • 260 tests green (against the device-types branch). ruff and mypy clean.

Note: the floor stays napalm-device-types>=4.22.0. retry_refused is in device-types' Unreleased section. Once a release with it exists, raise the floor to that version. netOrk's pin covers it until then.

For NetOrk/netork#1800. **Depends on NAPALM/napalm-device-types#63**: CI installs device-types from `main`, so this goes green once #63 is merged. OpenSSH 9.8+ (`PerSourcePenalties`) closes every connection from a source it has just penalised, before its banner, for seconds to minutes. A security scanner's probes earn the managing client exactly that. - `open()` wraps netmiko's `ConnectHandler` in device-types' `retry_refused`. A connection turned away before the banner is tried again after 1, 3, 7 and 15 s, 26 s in all. Everything else fails as before, including a host-key mismatch (the existing test is unchanged). - New test: `ConnectHandler` raises netmiko's wrapped "Error reading SSH protocol banner" twice, then connects. - 260 tests green (against the device-types branch). ruff and mypy clean. Note: the floor stays `napalm-device-types>=4.22.0`. `retry_refused` is in device-types' Unreleased section. Once a release with it exists, raise the floor to that version. netOrk's pin covers it until then.
christianmanivong added 1 commit 2026-10-31 23:27:07 +00:00
feat: open() waits out sshd's per-source penalty (NetOrk/netork#1800)
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Failing after 15s
driver / types (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Failing after 59s
driver / test (3.12) (pull_request) Failing after 1m9s
driver / lowest (pull_request) Failing after 28s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Failing after 2m17s
driver / publish (pull_request) Skipped
49b7d7fef7
OpenSSH 9.8+ closes every connection from a source it has just
penalised, before its banner, for seconds to minutes. open() now wraps
netmiko's ConnectHandler in napalm-device-types' retry_refused, so the
connection is tried again after 1, 3, 7 and 15 s instead of failing.
Needs NAPALM/napalm-device-types#63.
christianmanivong added 1 commit 2026-10-31 23:33:32 +00:00
fix: keep linux.py within its line count (quality ratchet)
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m5s
driver / test (3.13) (pull_request) Successful in 56s
driver / test (3.12) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m3s
CI / driver (pull_request) Successful in 2m14s
driver / publish (pull_request) Skipped
bff275402e
One handler for the two netmiko failures that both became a
ConnectionException, and the retry's note on its own line.
christianmanivong merged commit 812a162eef into main 2026-10-31 23:36:46 +00:00
christianmanivong deleted branch feat/ssh-penalties-1800 2026-10-31 23:36:46 +00:00
Sign in to join this conversation.