Commit Graph
144 Commits
Author SHA1 Message Date
christianmanivong 449a6b13ca refactor(ssh_server): split three functions under the standard's line limit (#65)
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 3m9s
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 / publish (pull_request) Skipped
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.
2026-11-01 08:17:27 +01:00
christianmanivong 1c71fe6896 Merge pull request 'feat: LocalAccountsMixin, personal accounts added and locked again (NetOrk/netork#1793)' (#62) from feat/local-accounts into main
driver / lint (push) Successful in 14s
driver / lowest (push) Failing after 5s
driver / test (3.13) (push) Successful in 1m2s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m11s
driver / publish (push) Skipped
driver / standard (push) Failing after 16s
driver / test (3.12) (push) Successful in 1m4s
driver / types (push) Successful in 1m6s
CI / driver (push) Failing after 2m47s
Reviewed-on: #62
2026-10-31 23:45:34 +00:00
christianmanivong 9159106837 Merge remote-tracking branch 'origin/main' into feat/local-accounts
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Failing after 2m35s
driver / standard (pull_request) Failing after 18s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 31s
driver / test (3.13) (pull_request) Successful in 58s
driver / publish (pull_request) Skipped
# Conflicts:
#	CHANGELOG.md
2026-11-01 00:45:06 +01:00
christianmanivong 28ff14589b Merge pull request 'feat: the managing client and sshd's per-source penalties (NetOrk/netork#1800)' (#63) from feat/ssh-penalties-1800 into main
driver / lint (push) Successful in 14s
driver / test (3.13) (push) Successful in 58s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 30s
driver / security (push) Successful in 1m4s
driver / publish (push) Skipped
driver / standard (push) Failing after 17s
driver / types (push) Successful in 1m2s
driver / test (3.12) (push) Successful in 1m4s
CI / driver (push) Failing after 2m21s
Reviewed-on: #63
2026-10-31 23:29:09 +00:00
christianmanivong 5fffb3b886 feat: the managing client and sshd's per-source penalties (NetOrk/netork#1800)
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Failing after 2m24s
driver / standard (pull_request) Failing after 9s
driver / lint (pull_request) Successful in 22s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m11s
driver / test (3.13) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 33s
driver / publish (pull_request) Skipped
OpenSSH 9.8+ penalises a source whose connections do not authenticate --
a scanner's probes -- and then drops every connection from it, the
managing client's included.

- OpenSshServerMixin.exempt_from_ssh_penalties puts the address the host
  sees the client at ($SSH_CONNECTION) into PerSourcePenaltyExemptList,
  next to the host's own exemptions, in its own drop-in. Only where sshd
  has the penalties (an older one refuses the directive) and includes the
  drop-in directory; checked with sshd -t, sshd -T and a new session, and
  taken back on any failure. The check-and-restore step of
  harden_ssh_server is shared for it.
- retry_refused tries a connection again after 1, 3, 7 and 15 s while
  sshd closes it before its banner; HostKeyCheck.connect uses it.
2026-11-01 00:24:11 +01:00
christianmanivong 2846824a21 feat: a host may add a key file sshd reads (NetOrk/netork#1793)
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 2m45s
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / lowest (pull_request) Successful in 39s
driver / test (3.13) (pull_request) Successful in 1m23s
driver / publish (pull_request) Skipped
_account_key_files says which files hold an account's keys; the default is
~/.ssh/authorized_keys and authorized_keys2. OpenMediaVault adds the file it
deploys under /var/lib/openmediavault/ssh/authorized_keys, so reading an
account back sees every key sshd would take.
2026-10-31 23:31:05 +01:00
christianmanivong 0545d1d814 feat: a driver may keep the account keys elsewhere (NetOrk/netork#1793)
driver / build (pull_request) Successful in 34s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 2m44s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m6s
driver / test (3.13) (pull_request) Successful in 1m8s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / lowest (pull_request) Successful in 36s
driver / publish (pull_request) Skipped
OpenMediaVault keeps a user's keys in its own database and deploys them
to /var/lib/openmediavault/ssh/authorized_keys, and creates a home only
when its home directory setting is on. The key store becomes three hooks
with the ~/.ssh default: _account_read_keys, _account_add_key and
_account_remove_keys, each given the account's home.
2026-10-31 23:29:46 +01:00
christianmanivong 49c65cbd5d feat: LocalAccountsMixin, personal accounts added and locked again (NetOrk/netork#1793)
driver / build (pull_request) Successful in 36s
driver / security (pull_request) Successful in 1m21s
CI / driver (pull_request) Successful in 3m6s
driver / standard (pull_request) Successful in 25s
driver / lint (pull_request) Successful in 30s
driver / types (pull_request) Successful in 1m36s
driver / test (3.13) (pull_request) Successful in 1m15s
driver / test (3.12) (pull_request) Successful in 1m41s
driver / lowest (pull_request) Successful in 46s
driver / publish (pull_request) Skipped
get_local_accounts(names) reads a person's account back: groups, lock,
sudo, key files. add_local_account() creates or reopens one with the
person's key, optional password hash and optional sudo rule;
lock_local_account() takes the keys and sudo away and refuses every
login, keeping the home.

Every command root runs is one fixed command, so a sudoers allowlist can
name it. The key files are read and written as the person (sudo -n -u),
never as root, since a link in a home the person owns may point anywhere.
The sudo rule is a drop-in of its own, checked with visudo before and
sudo -l after; a rule elsewhere (cloud-init's) is reported, not edited.
The login user's own account and system accounts are refused.

A driver supplies creating, opening, locking, reading the lock and
leaving a group.
2026-10-31 23:24:27 +01:00
christianmanivong 888a7229dc Merge pull request 'feat: SudoHistoryMixin, the sudo password left in shell histories (NetOrk/netork#1090)' (#60) from feat/sudo-history-cleanup into main
driver / lint (push) Successful in 16s
driver / test (3.13) (push) Successful in 1m3s
driver / build (push) Successful in 34s
driver / security (push) Successful in 1m5s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / types (push) Successful in 1m1s
driver / test (3.12) (push) Successful in 1m10s
driver / lowest (push) Successful in 32s
CI / driver (push) Successful in 2m25s
2026-10-30 20:47:48 +00:00
christianmanivong 0f0064c2d7 test: the fake host never answers with this machine's uid
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Successful in 2m32s
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / test (3.13) (pull_request) Successful in 1m16s
driver / lowest (pull_request) Successful in 36s
driver / publish (pull_request) Skipped
CI runs as root, which the owner step skips, so three owner tests failed there
while they passed for a normal user.
2026-10-30 21:44:40 +01:00
christianmanivong cb90fa9835 feat: SudoHistoryMixin, the sudo password left in shell histories (NetOrk/netork#1090)
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Failing after 2m24s
driver / standard (pull_request) Failing after 7s
driver / lint (pull_request) Successful in 20s
driver / types (pull_request) Successful in 1m8s
driver / test (3.12) (pull_request) Failing after 1m9s
driver / test (3.13) (pull_request) Failing after 1m3s
driver / lowest (pull_request) Failing after 33s
driver / publish (pull_request) Skipped
A driver that typed `echo '<password>' | sudo -S -p "" <command>` into an
interactive shell left that line, password and all, in the login user's
shell history once per command, and where only the part before the first
`&&` ran as root, files root should own were left to the login user.

get_history_sudo_lines() counts the lines per history file with grep -c,
as the login user, without reading any back. remove_history_sudo_lines()
deletes exactly those lines with sed -i, overwrites the backup with
shred -u, and as root gives the driver's SUDO_ROOT_FILES back to root:root
where each is a regular file, not a link, owned by the login user. It
reports each file's lines before and after. Nothing goes to stdin.

The driver names the marker and the files and supplies run_command.
2026-10-30 21:09:24 +01:00
christianmanivong 551ed0a29d Merge pull request 'feat: NetworkTargetDict.uplinks, the NICs a bridge leaves through (NetOrk/netork#1325)' (#58) from feat/network-target-uplinks into main
driver / lint (push) Successful in 16s
driver / test (3.13) (push) Successful in 1m8s
driver / lowest (push) Successful in 31s
driver / build (push) Successful in 32s
driver / security (push) Successful in 1m8s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
driver / types (push) Successful in 1m3s
driver / test (3.12) (push) Successful in 1m16s
CI / driver (push) Successful in 2m34s
2026-10-30 09:54:19 +00:00
christianmanivong 0dc1a598e2 Merge remote-tracking branch 'origin/main' into feat/network-target-uplinks
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 3m1s
driver / standard (pull_request) Successful in 24s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m2s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / lowest (pull_request) Successful in 32s
driver / test (3.13) (pull_request) Successful in 59s
driver / publish (pull_request) Skipped
# Conflicts:
#	CHANGELOG.md
2026-10-30 10:20:48 +01:00
christianmanivong 131346c228 Merge pull request 'feat: ARP_AGE_UNKNOWN, the age of a neighbour the device does not report' (#57) from fix/arp-unknown-age into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m7s
driver / lowest (push) Successful in 33s
driver / build (push) Successful in 42s
driver / security (push) Successful in 1m16s
driver / publish (push) Skipped
driver / standard (push) Successful in 19s
driver / types (push) Successful in 1m5s
driver / test (3.12) (push) Successful in 1m12s
CI / driver (push) Successful in 3m5s
2026-10-30 09:20:21 +00:00
christianmanivong a5b7b540c6 feat: NetworkTargetDict.uplinks, the NICs a bridge leaves through (NetOrk/netork#1325)
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m12s
CI / driver (pull_request) Successful in 2m47s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 36s
driver / publish (pull_request) Skipped
A VM on a VLAN-aware bridge without a VLAN tag only gets an address when
the switch port behind the bridge carries an untagged network. To find
that port, the caller needs the bridge's physical NICs: their LLDP
neighbours name the switch and the port.

uplinks lists them in groups, one per way out of the bridge: a bond's
slaves together, a single NIC alone. A bond is one link, so a caller can
let one slave's neighbour speak for the others when lldpd sees only one.
Internal, VLAN and virtual ports are no uplinks. A missing key means the
driver cannot tell; an empty list is a bridge without uplink.
2026-10-30 09:27:23 +01:00
christianmanivong 874c6c5a92 feat: ARP_AGE_UNKNOWN, the age of a neighbour the device does not report
driver / build (pull_request) Successful in 35s
driver / security (pull_request) Successful in 1m15s
CI / driver (pull_request) Successful in 3m3s
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 18s
driver / types (pull_request) Successful in 1m12s
driver / test (3.12) (pull_request) Successful in 1m13s
driver / test (3.13) (pull_request) Successful in 1m8s
driver / lowest (pull_request) Successful in 31s
driver / publish (pull_request) Skipped
NAPALM requires an age on every entry of get_arp_table and
get_ipv6_neighbors_table. Many devices do not report one, and drivers
filled in 0.0, which means "confirmed just now". ARP_AGE_UNKNOWN (-1.0, as
NAPALM's IOS driver reports) is the value for "not reported"; the README
states the contract.

NetOrk/netork#1327
2026-10-30 08:37:08 +01:00
christianmanivong 145c2c668b Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#56) from chore/python-312-floor into main
driver / lint (push) Successful in 13s
driver / test (3.13) (push) Successful in 57s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 27s
driver / security (push) Successful in 59s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / types (push) Successful in 55s
driver / test (3.12) (push) Successful in 58s
CI / driver (push) Successful in 2m25s
2026-10-27 10:19:37 +00:00
Christian Manivong 1cef3385e8 fix: the floor on napalm is 5.1 (NAPALM/driver-standard#6)
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Successful in 2m49s
driver / standard (pull_request) Successful in 21s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m13s
driver / test (3.13) (pull_request) Successful in 55s
driver / lowest (pull_request) Successful in 28s
driver / publish (pull_request) Skipped
napalm 5.0 and older import pkg_resources, which a Python 3.12 venv no
longer has, so the lowest job failed on them.
2026-10-27 10:49:27 +01:00
Christian Manivong fbd3cf0129 chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m13s
CI / driver (pull_request) Failing after 2m50s
driver / standard (pull_request) Successful in 21s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m2s
driver / lowest (pull_request) Failing after 30s
driver / test (3.13) (pull_request) Successful in 1m0s
driver / publish (pull_request) Skipped
netOrk runs every driver in its own containers on Python 3.12, so 3.10
and 3.11 are no longer supported or tested. requires-python, mypy and
ruff move to 3.12, along with what ruff's pyupgrade rules then rewrite.
2026-10-27 10:18:55 +01:00
christianmanivong e400c4359c Merge pull request 'feat: shutdown_host and begin_stop_vm, shutting down without waiting' (#55) from feat/shutdown-requests into main
driver / lint (push) Successful in 14s
driver / test (3.13) (push) Successful in 1m7s
driver / build (push) Successful in 30s
driver / security (push) Successful in 1m9s
driver / publish (push) Skipped
driver / types (push) Successful in 1m25s
driver / test (3.11) (push) Successful in 1m21s
driver / test (3.10) (push) Successful in 1m23s
driver / lowest (push) Successful in 34s
driver / test (3.12) (push) Successful in 1m22s
driver / standard (push) Successful in 15s
CI / driver (push) Successful in 3m20s
2026-10-27 07:41:23 +00:00
christianmanivong 4d3574cd60 feat: shutdown_host and begin_stop_vm, shutting down without waiting
driver / test (3.10) (pull_request) Failing after 6s
driver / test (3.11) (pull_request) Successful in 1m13s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Failing after 2m41s
driver / lint (pull_request) Successful in 18s
driver / standard (pull_request) Successful in 20s
driver / types (pull_request) Successful in 1m4s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / lowest (pull_request) Successful in 43s
driver / publish (pull_request) Skipped
HostShutdownMixin.shutdown_host(), on DeviceTypeDriver: a device shuts
itself down cleanly through its own means; declared, so hasattr says
whether a driver can. There is no forced variant.

VmStopRequestMixin.begin_stop_vm(name): ask for a VM's clean shutdown
and return at once, for a caller that waits on a timer and reads
get_vm_status instead of blocking in stop_vm. No role demands it.

For netOrk's graph workflows, which switch a hypervisor off when CI has
nothing for it (NetOrk/netork#1636).
2026-10-27 00:36:54 +01:00
christianmanivong 87dbdfac66 Merge pull request 'feat: AptProxyMixin, what apt fetches through and pointing it at a proxy (NetOrk/netork#1397)' (#53) from feat/apt-proxy-verify into main
driver / lint (push) Successful in 12s
driver / test (3.13) (push) Successful in 48s
driver / build (push) Successful in 25s
driver / security (push) Successful in 52s
driver / publish (push) Successful in 26s
driver / standard (push) Successful in 16s
driver / types (push) Successful in 48s
driver / test (3.10) (push) Successful in 55s
driver / test (3.11) (push) Successful in 53s
driver / lowest (push) Successful in 33s
driver / test (3.12) (push) Successful in 56s
CI / driver (push) Successful in 43m47s
v4.22.0
2026-10-23 10:01:40 +00:00
christianmanivong a07ced2df6 Merge branch 'main' into feat/apt-proxy-verify
driver / test (3.10) (pull_request) Successful in 50s
driver / test (3.11) (pull_request) Successful in 48s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 23s
CI / driver (pull_request) Successful in 7m2s
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 1m24s
driver / types (pull_request) Successful in 44s
driver / test (3.12) (pull_request) Successful in 48s
driver / test (3.13) (pull_request) Successful in 41s
driver / lowest (pull_request) Successful in 24s
driver / publish (pull_request) Skipped
The NAPALM driver standard landed on main (#52, 4.21.1). apt_proxy follows
it: builtin generics, strict mypy, complexity 10 at most (parse_apt_proxy,
same_proxy_url and the comment-out step split into helpers), 100 % covered.
Its TypedDicts live in apt_proxy.py, since models.py is over 1000 lines and
may not grow. Version 4.22.0 with its CHANGELOG section.
2026-10-23 00:14:59 +02:00
christianmanivong 22e4377c2b Merge pull request 'chore: adopt the NAPALM driver standard (pilot)' (#52) from chore/driver-standard into main
driver / lint (push) Successful in 11s
driver / test (3.13) (push) Successful in 56s
driver / lowest (push) Successful in 36s
driver / security (push) Successful in 55s
driver / build (push) Successful in 26s
driver / publish (push) Skipped
driver / standard (push) Successful in 13s
driver / types (push) Successful in 43s
driver / test (3.10) (push) Successful in 51s
driver / test (3.11) (push) Successful in 48s
driver / test (3.12) (push) Successful in 49s
CI / driver (push) Successful in 6m28s
v4.21.1
2026-10-22 22:08:14 +00:00
christianmanivong 49830671c9 chore(release): 4.21.1
driver / test (3.10) (pull_request) Successful in 3m3s
driver / test (3.11) (pull_request) Successful in 49s
driver / security (pull_request) Successful in 3m10s
driver / build (pull_request) Successful in 4m38s
CI / driver (pull_request) Successful in 21m52s
driver / standard (pull_request) Successful in 36s
driver / lint (pull_request) Successful in 1m12s
driver / types (pull_request) Successful in 1m12s
driver / test (3.12) (pull_request) Successful in 1m53s
driver / test (3.13) (pull_request) Successful in 4m52s
driver / lowest (pull_request) Successful in 26s
driver / publish (pull_request) Skipped
2026-10-22 21:12:28 +02:00
christianmanivong d7ec558933 feat: AptProxyMixin, what apt fetches through and pointing it at a proxy (NetOrk/netork#1397)
CI / test (3.10) (push) Successful in 31s
CI / test (3.11) (push) Successful in 30s
CI / test (3.13) (push) Successful in 33s
CI / test (3.10) (pull_request) Successful in 30s
CI / test (3.12) (pull_request) Successful in 29s
CI / test (3.12) (push) Successful in 30s
CI / test (3.11) (pull_request) Successful in 28s
CI / test (3.13) (pull_request) Successful in 29s
apt reads apt.conf.d in order and apt.conf last; the last value wins. The
Debian installer writes its proxy into apt.conf, Ubuntu's into
90curtin-aptproxy: reading 00proxy alone missed both, and a fix that wrote
00proxy and read it back reported success while apt fetched elsewhere.

- get_package_proxy_report(): apt-config dump's proxy, per-host overrides,
  auto-detect, every line of apt's files that sets it (in reading order,
  editable or inside a block), the http and https sources.
- check_package_proxy(url, expect): a fetch with apt-helper, past any proxy;
  an HTTP error counts as an answer.
- configure_package_proxy(url): write 00proxy, comment out other proxy
  lines, read apt's proxy back, fetch one InRelease through it.
- same_proxy_url(): scheme, host and port, a trailing slash aside.

A driver supplies _run_apt_command, _run_apt_root_command and
_write_apt_file. Version 4.22.0.
2026-10-22 19:16:40 +02:00
christianmanivong 0475184684 chore: adopt the NAPALM driver standard
driver / test (3.10) (pull_request) Successful in 1m43s
driver / test (3.11) (pull_request) Failing after 9m18s
driver / security (pull_request) Failing after 4m33s
driver / build (pull_request) Failing after 1m29s
CI / driver (pull_request) Failing after 24m6s
driver / standard (pull_request) Successful in 54s
driver / lint (pull_request) Successful in 50s
driver / types (pull_request) Failing after 1m17s
driver / test (3.12) (pull_request) Failing after 1m20s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Failing after 1m38s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard: conformance, ruff, strict mypy, tests on
  3.10-3.13 and at the lowest declared versions, bandit, pip-audit, build,
  and on a release tag the upload to PyPI.
- tests/quality_baseline.json records today's long and complex functions
  and the one file over 1000 lines; they may shrink, not grow.
- Coverage floor 95 % (measured 95.15 %).
- CHANGELOG.md starts here; project links point at git.netork.io; the
  license is the SPDX string PEP 639 wants.
2026-10-22 19:06:19 +02:00
christianmanivong b7350a9b2c fix: what bandit and the remaining lint rules found
- Long docstring and command lines are wrapped; recorded device output in
  tests/ keeps its lines (E501 is off there).
- host_firewall: the negation token is the named constant _NEGATION. bandit
  read token == "!" as a hardcoded password.
- ssh_host_keys: _known_hosts_file takes the expected key as an argument
  instead of asserting it; both callers had already returned when it is None.
- ssh_server: the staged path is on the device, not a local temp file
  (nosec B108).
- tests: raise ... from exc, zip(strict=True).
2026-10-22 19:05:11 +02:00
christianmanivong 08296d0d2e style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100). typing.List/Dict/Optional
become builtin generics and X | None, imports are sorted, the coding cookies
are gone. Two tests that read the source text follow the new spelling.

What ruff cannot fix comes in the next commit.
2026-10-22 19:03:21 +02:00
christianmanivong ac8e7c4c11 Merge pull request 'feat: HostFirewallMixin, a Linux host's own netfilter rules (NetOrk/netork#1344)' (#51) from feat/host-firewall-1344 into main
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 28s
CI / test (3.13) (push) Successful in 25s
CI / test (3.12) (push) Successful in 38s
2026-10-21 21:26:36 +00:00
christianmanivong f77091c489 feat: HostFirewallMixin, a Linux host's own netfilter rules (NetOrk/netork#1344)
CI / test (3.10) (push) Successful in 40s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 51s
CI / test (3.10) (pull_request) Successful in 24s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.12) (push) Successful in 25s
CI / test (3.11) (pull_request) Successful in 26s
CI / test (3.13) (pull_request) Successful in 25s
get_host_firewall() reads `nft -j list ruleset` as root and returns every
chain with its family, table, hook, priority and policy, and every rule as
matches and a verdict. Rules iptables-nft wrote show their extensions in nft's
JSON only as an opaque `xt`, so the tables iptables manages are taken from
iptables-save instead; a legacy iptables is kept beside nft's tables, since
both apply. A condition the parse does not model is an `unknown` match with
its text, never left out. Without root neither tool can be read, and
HostFirewallUnavailable is raised rather than a host without rules.

A driver supplies only _run_host_firewall_command(command, privileged=).
Version 4.21.0.
2026-10-21 23:10:44 +02:00
christianmanivong be3958e561 Merge pull request 'feat: ServicePackagesMixin, which packages a systemd service is (NetOrk/netork#1236)' (#50) from feat/service-packages-1236 into main
CI / test (3.10) (push) Successful in 31s
CI / test (3.11) (push) Successful in 28s
CI / test (3.13) (push) Successful in 36s
CI / test (3.12) (push) Successful in 36s
2026-10-19 16:56:15 +00:00
christianmanivong a21e365c4e fix: annotate the unit path set so mypy accepts service_packages (NetOrk/netork#1236)
CI / test (3.10) (push) Successful in 44s
CI / test (3.11) (push) Successful in 33s
CI / test (3.13) (push) Successful in 30s
CI / test (3.10) (pull_request) Successful in 42s
CI / test (3.12) (pull_request) Successful in 38s
CI / test (3.12) (push) Successful in 32s
CI / test (3.11) (pull_request) Successful in 43s
CI / test (3.13) (pull_request) Successful in 35s
2026-10-19 18:50:41 +02:00
christianmanivong cce26eff44 feat: ServicePackagesMixin, which packages a systemd service is (NetOrk/netork#1236)
CI / test (3.10) (push) Failing after 17s
CI / test (3.11) (push) Failing after 14s
CI / test (3.13) (push) Failing after 16s
CI / test (3.10) (pull_request) Failing after 17s
CI / test (3.12) (pull_request) Failing after 20s
CI / test (3.12) (push) Failing after 15s
CI / test (3.11) (pull_request) Failing after 15s
CI / test (3.13) (pull_request) Failing after 26s
get_service_packages() returns, per systemd service, the installed packages
it is made of: the one shipping its unit file and the one shipping the
binary its ExecStart runs -- not the libraries that binary links against.
One read-only command: systemctl show for every loaded service unit, then
one dpkg -S for all paths (each also across the /usr merge), or rpm -qf per
path. The report is framed; one cut short raises. A driver supplies
_run_service_packages_command, as for KernelFactsMixin.

Version 4.20.0.
2026-10-19 17:38:57 +02:00
christianmanivong 888a11ca6a Merge pull request 'feat: ssh_host_keys.HostKeyCheck, trust on first use (NetOrk/netork#1167)' (#49) from fix/ssh-host-key-tofu-1167 into main
CI / test (3.10) (push) Successful in 35s
CI / test (3.11) (push) Successful in 41s
CI / test (3.13) (push) Successful in 29s
CI / test (3.12) (push) Successful in 32s
2026-10-18 19:23:26 +00:00
christianmanivong 94bf399d34 feat: ssh_host_keys.HostKeyCheck, trust on first use (NetOrk/netork#1167)
CI / test (3.10) (push) Successful in 35s
CI / test (3.11) (push) Successful in 41s
CI / test (3.13) (push) Successful in 33s
CI / test (3.10) (pull_request) Successful in 29s
CI / test (3.12) (pull_request) Successful in 33s
CI / test (3.12) (push) Successful in 38s
CI / test (3.11) (pull_request) Successful in 28s
CI / test (3.13) (pull_request) Successful in 40s
Drivers get the host keys to expect in optional_args["ssh_host_keys"] (by port)
and report what they saw through optional_args["ssh_host_key_observer"].
With a known key, any other key is refused before authentication
(SshHostKeyMismatch); without one, the first key is accepted. One
implementation for paramiko (HostKeyCheck.connect) and netmiko
(HostKeyCheck.netmiko + observe). A caller or driver that ignores both keys
keeps working as before.

Version 4.19.0.
2026-10-18 21:23:25 +02:00
christianmanivong bb2229fd9e Merge pull request 'chore: release the service clusters as 4.18.0' (#48) from chore/4.18.0 into main
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 27s
CI / test (3.12) (push) Successful in 26s
2026-10-18 13:42:42 +00:00
christianmanivong 680500dd2e chore: release the service clusters as 4.18.0
CI / test (3.10) (push) Successful in 27s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 27s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 25s
CI / test (3.13) (pull_request) Successful in 26s
feat/service-clusters (#47) and feat/opnsense-public-contracts (#46) both
called themselves 4.17.0 and were merged one after the other: two trees
under one version. 4.17.0 stays the public contracts (83cd7db, pinned by
netOrk for #1113); the service clusters on top of it are 4.18.0.
2026-10-18 15:38:29 +02:00
christianmanivong a0e70d1686 Merge pull request 'feat: the configuration that says which services run together (4.17.0)' (#47) from feat/service-clusters into main
CI / test (3.10) (push) Successful in 27s
CI / test (3.11) (push) Successful in 24s
CI / test (3.13) (push) Successful in 26s
CI / test (3.12) (push) Successful in 27s
2026-10-18 13:32:33 +00:00
christianmanivong 2bd7bcc77c feat: the configuration that says which services run together (4.17.0)
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 24s
CI / test (3.13) (push) Successful in 27s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 25s
CI / test (3.13) (pull_request) Successful in 26s
ServiceClustersMixin.get_service_clusters() -> ServiceClustersDict
{patroni, adguardhome_sync, bunkerweb}: per mechanism the clusters the
host's configuration says it belongs to, each with its members (address,
port, name, role as the mechanism words it, this_host, config_from) and the
unit or container it was read from (source).

- Patroni: scope, name and restapi.connect_address from its YAML, then the
  members and roles /cluster lists from the DCS.
- adguardhome-sync: ORIGIN_URL and REPLICA*_URL; the origin pushes to each
  replica.
- BunkerWeb: a worker's API_WHITELIST_IP names the manager it admits, a
  manager's BUNKERWEB_INSTANCES its workers.

Two hosts answering at one virtual IP prove nothing; this is the evidence
that they run one service (NetOrk/netork#1125). One generic command for
every Linux host, filtered on the host like the virtual IPs' one:
allowlisted fields only, URLs without user:password@, DCS endpoints stay
there. Root first, then without it; None per mechanism is "did not look".
2026-10-18 15:28:34 +02:00
christianmanivong 83cd7db761 Merge pull request 'feat: public contracts for update progress, DNS forwards and OSPF (4.17.0)' (#46) from feat/opnsense-public-contracts into main
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 28s
CI / test (3.12) (push) Successful in 28s
2026-10-18 13:06:07 +00:00
Christian Manivong 1dd448e1d3 feat: public contracts for update progress, DNS forwards and OSPF (4.17.0)
CI / test (3.10) (push) Successful in 35s
CI / test (3.11) (push) Successful in 32s
CI / test (3.13) (push) Successful in 27s
CI / test (3.10) (pull_request) Successful in 27s
CI / test (3.12) (pull_request) Successful in 26s
CI / test (3.12) (push) Successful in 30s
CI / test (3.11) (pull_request) Successful in 25s
CI / test (3.13) (pull_request) Successful in 26s
An application followed a firewall's upgrade, edited its resolver's
forwards and read its OSPF state through the driver's private REST
helpers (NetOrk/netork#1113). Declared contracts, neutral shapes:

- UpdateMixin.get_update_progress() -> UpdateProgressDict {state, log}
  for an update apply_updates only starts.
- DnsForwardMixin: get_dns_forwards(), set_dns_forward(domain, server,
  port), remove_dns_forward(domain); the driver applies.
- OspfMixin.get_ospf() -> OspfDict {router_id, areas, interfaces}; the
  routing daemon's format is the driver's to translate.

All declared only.
2026-10-18 15:02:15 +02:00
christianmanivong 753ddc5eda Merge pull request 'feat: the firmware a vendor offers, as a fact (4.16.0)' (#45) from feat/firmware-offer into main
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 26s
CI / test (3.12) (push) Successful in 26s
2026-10-17 11:04:22 +00:00
christianmanivong 59fb1273e8 feat: the firmware a vendor offers, as a fact (4.16.0)
CI / test (3.10) (push) Successful in 27s
CI / test (3.11) (push) Successful in 24s
CI / test (3.13) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 24s
CI / test (3.13) (pull_request) Successful in 25s
FirmwareOfferMixin.get_firmware_offer() -> FirmwareOfferDict
{current_version, latest_version, newer, download_url?}: what runs and
the newest firmware the vendor offers, from its download catalogue or
the device's own update check. Comparing vendor version strings stays
with the driver, so it says whether the offer is newer; whether that is a
warning is the application's call (NetOrk/netork#1111). Declared only.
2026-10-17 13:00:43 +02:00
christianmanivong 4641063db6 Merge pull request 'feat: a missing license can say what the device withholds without it (4.15.0)' (#44) from feat/license-withholds into main
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 27s
CI / test (3.13) (push) Successful in 37s
CI / test (3.12) (push) Successful in 32s
2026-10-17 09:41:28 +00:00
christianmanivong 634c142477 test: read the withholds hint the way Python 3.10 reports it
CI / test (3.10) (push) Successful in 35s
CI / test (3.11) (push) Successful in 34s
CI / test (3.13) (push) Successful in 34s
CI / test (3.10) (pull_request) Successful in 33s
CI / test (3.12) (pull_request) Successful in 31s
CI / test (3.12) (push) Successful in 36s
CI / test (3.11) (pull_request) Successful in 30s
CI / test (3.13) (pull_request) Successful in 32s
2026-10-17 11:36:32 +02:00
christianmanivong 2d1c40c87d feat: a missing license can say what the device withholds without it (4.15.0)
CI / test (3.10) (push) Failing after 19s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 28s
CI / test (3.10) (pull_request) Failing after 20s
CI / test (3.12) (pull_request) Successful in 30s
CI / test (3.12) (push) Successful in 29s
CI / test (3.11) (pull_request) Successful in 26s
CI / test (3.13) (pull_request) Successful in 32s
LicenseDict gets withholds: NotRequired[List[str]]: what a device keeps back
for want of a license while the rest of it answers. A Supermicro X10 with
only SFT-OOB-LIC answers Redfish but withholds its drives and firmware
inventory until DCMS is activated. That makes it partly licensed, not
unlicensed, and the caller can tell the two apart (NetOrk/netork#1111).
2026-10-17 11:32:10 +02:00
christianmanivong 87c9b06bf3 Merge pull request 'feat: licenses, a hypervisor's hosts and the package proxy as facts (4.14.0)' (#43) from feat/fact-getters-1111 into main
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 26s
CI / test (3.13) (push) Successful in 35s
CI / test (3.12) (push) Successful in 36s
2026-10-17 07:19:33 +00:00
christianmanivong 2805f911c4 feat: licenses, a hypervisor's hosts and the package proxy as facts (4.14.0)
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 32s
CI / test (3.13) (push) Successful in 35s
CI / test (3.10) (pull_request) Successful in 31s
CI / test (3.12) (pull_request) Successful in 30s
CI / test (3.12) (push) Successful in 35s
CI / test (3.11) (pull_request) Successful in 27s
CI / test (3.13) (pull_request) Successful in 29s
Drivers report facts and the application decides what is a warning
(docs/STRUCTURE.md, NetOrk/netork#1111). Three facts drivers so far
only reported as warning codes get contracts:

- LicenseMixin.get_licenses(): licenses and subscriptions with their
  status (a Proxmox subscription, a VMware edition, a BMC license a
  feature needs).
- HypervisorDriver.get_hypervisor_hosts(): each host connected, in
  maintenance, with configuration issues, under a central manager.
- PackageProxyMixin.get_package_proxy(): the proxy apt fetches through.

All declared only.
2026-10-17 09:12:20 +02:00
christianmanivong 6551008ad3 Merge pull request 'feat: fix routines as templates with the caller's values; deprecate run_device_action (4.13.0)' (#41) from feat/fix-templates-33 into main
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 32s
CI / test (3.13) (push) Successful in 34s
CI / test (3.12) (push) Successful in 36s
2026-10-16 22:43:22 +00:00