24f4be3b7e3d8ef117a73a44ca69c8583cc7dde5
80
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4938056d20 |
Merge remote-tracking branch 'origin/main' into feat/vm-create-partial-failure
# Conflicts: # CHANGELOG.md |
||
|
|
a6289cb24a |
feat: HA state, backups, quorum votes, migrate_vm and node maintenance
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m3s
CI / driver (pull_request) Successful in 2m30s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 30s
driver / test (3.13) (pull_request) Successful in 58s
driver / publish (pull_request) Skipped
get_clusters() may also report the cluster's HA resources, backup jobs, the newest backup per guest and storage, and each node's quorum votes (all NotRequired; None means not read). HypervisorDriver declares get_vm_migration_preflight(), migrate_vm() and set_node_maintenance(); the preflight shape lives in vm_migration.py. Part of NetOrk/netork#1820 (stage 7: #759, #760, #761). |
||
|
|
4150570a94 |
feat: VMProvisionIncomplete names the VM a failed creation left behind
driver / lowest (pull_request) Successful in 37s
driver / build (pull_request) Successful in 35s
driver / security (pull_request) Successful in 1m15s
CI / driver (pull_request) Failing after 3m1s
driver / standard (pull_request) Failing after 17s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m13s
driver / test (3.13) (pull_request) Successful in 1m6s
driver / publish (pull_request) Skipped
create_vm_from_cloud_init raised a plain error once the VM existed, so the caller had no id to remove it by. The new RuntimeError carries vmid and node, with the failure as its cause; a failure before the VM exists raises as before. Refs NAPALM/napalm-proxmox#28 |
||
|
|
00aa5efef0 |
feat: get_clusters() and create_vm_from_cloud_init(node=)
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m0s
CI / driver (pull_request) Failing after 2m32s
driver / lint (pull_request) Successful in 16s
driver / standard (pull_request) Failing after 19s
driver / types (pull_request) Successful in 1m10s
driver / test (3.13) (pull_request) Successful in 1m13s
driver / test (3.12) (pull_request) Successful in 1m19s
driver / publish (pull_request) Skipped
A hypervisor reports every cluster its connection can see: the cluster's name and quorum, its nodes (offline ones too, the local one marked) with CPU and memory, and the storages and networks with the nodes that see each. A standalone host is a cluster of one without a name; a manager reports each cluster and standalone host it runs. Declared only, so a capability check stays truthful. create_vm_from_cloud_init() takes the node to create the VM on; a driver that can only create on its own node refuses another. Refs NetOrk/netork#484, NetOrk/netork#1822 |
||
|
|
47751d12d6 |
fix: another service's account of the same name is left alone (NetOrk/netork#1817)
driver / lowest (pull_request) Successful in 30s
driver / security (pull_request) Successful in 55s
driver / build (pull_request) Successful in 26s
CI / driver (pull_request) Successful in 56s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 56s
driver / publish (pull_request) Skipped
On bw-01, netork is the satellite's own user (nologin, in docker). add_service_account opened it, gave it the passwordless sudo rule and netOrk's key, and only the login as it failed. An account that is there and cannot log in (nologin, false) is now refused before anything changes. |
||
|
|
3f59023f46 |
feat: a fixed uid for netOrk's own account (NetOrk/netork#1817)
driver / lowest (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m3s
driver / build (pull_request) Successful in 26s
CI / driver (pull_request) Successful in 1m10s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m2s
driver / test (3.12) (pull_request) Successful in 1m10s
driver / publish (pull_request) Skipped
add_service_account(uid=) makes a new account with that uid once no other account has it, through the driver's _account_create_with_uid; an account that is there keeps its own, as a uid is never changed under files that carry it. The infrastructure's build standard wants the same uid on every host. |
||
|
|
666be091e3 |
feat: netOrk's own account through the current login (NetOrk/netork#1817)
driver / lowest (pull_request) Successful in 50s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Failing after 2m35s
driver / lint (pull_request) Failing after 7s
driver / standard (pull_request) Successful in 21s
driver / types (pull_request) Successful in 1m10s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m6s
driver / publish (pull_request) Skipped
add_service_account(name, public_key) creates or reopens the account through the login the driver uses today: a key and no password, and a rule of its own in 85-service-<name> that lets it run everything as root without a password, checked with visudo and sudo -l. Root is refused; run again with the account the driver already logs in with, it only adds what is missing. |
||
|
|
86959b7599 |
Merge remote-tracking branch 'origin/main' into fix/apt-https-proxy
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m50s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / test (3.13) (pull_request) Successful in 1m0s
driver / lowest (pull_request) Successful in 33s
driver / publish (pull_request) Skipped
|
||
|
|
449a6b13ca |
refactor(ssh_server): split three functions under the standard's line limit (#65)
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 / 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 / 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. |
||
|
|
3b6c5f9585 |
fix(apt_proxy): https sources take the http proxy too (NetOrk/netork#1811)
driver / lowest (pull_request) Successful in 33s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m22s
driver / lint (pull_request) Successful in 17s
driver / standard (pull_request) Failing after 18s
driver / types (pull_request) Successful in 1m7s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m7s
driver / publish (pull_request) Skipped
apt's https method asks Acquire::https::Proxy and then Acquire::http::Proxy, for the host and then for all. An 00proxy with the http line alone therefore sent download.docker.com and every other https source to apt-cacher-ng, which answers 403 CONNECT denied without a PassThroughPattern, and the whole upgrade failed. - The report carries https_proxy, https_per_host and https_settings; https_proxy_for(report, host) is the proxy apt takes for one https host. - check_https_source() fetches one https source the way apt does. - configure_package_proxy gains an https step: one https source through the new proxy. Where the proxy refuses it, 00proxy also says Acquire::https::Proxy "DIRECT", later https lines to the same proxy are commented out, and the source is fetched direct. An HTTP error from the mirror counts as let through. - apt_fetch_command takes https URLs; comment_out_command takes a scheme. |
||
|
|
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 |
||
|
|
5fffb3b886 |
feat: the managing client and sshd's per-source penalties (NetOrk/netork#1800)
driver / lowest (pull_request) Successful in 33s
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 / 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. |
||
|
|
2846824a21 |
feat: a host may add a key file sshd reads (NetOrk/netork#1793)
driver / lowest (pull_request) Successful in 39s
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 / 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. |
||
|
|
0545d1d814 |
feat: a driver may keep the account keys elsewhere (NetOrk/netork#1793)
driver / lowest (pull_request) Successful in 36s
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 / 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. |
||
|
|
49c65cbd5d |
feat: LocalAccountsMixin, personal accounts added and locked again (NetOrk/netork#1793)
driver / lowest (pull_request) Successful in 46s
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 / 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. |
||
|
|
0f0064c2d7 |
test: the fake host never answers with this machine's uid
driver / lowest (pull_request) Successful in 36s
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 / 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. |
||
|
|
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. |
||
|
|
0dc1a598e2 |
Merge remote-tracking branch 'origin/main' into feat/network-target-uplinks
driver / lowest (pull_request) Successful in 32s
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 / test (3.13) (pull_request) Successful in 59s
driver / publish (pull_request) Skipped
# Conflicts: # CHANGELOG.md |
||
|
|
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. |
||
|
|
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 |
||
|
|
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. |
||
|
|
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 / lowest (pull_request) Successful in 43s
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 / 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). |
||
|
|
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. |
||
|
|
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.13) (pull_request) Successful in 29s
CI / test (3.12) (push) Successful in 30s
CI / test (3.11) (pull_request) Successful in 28s
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. |
||
|
|
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 / lowest (pull_request) Failing after 1m38s
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 / 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. |
||
|
|
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). |
||
|
|
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. |
||
|
|
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.13) (pull_request) Successful in 25s
CI / test (3.12) (push) Successful in 25s
CI / test (3.11) (pull_request) Successful in 26s
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. |
||
|
|
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.13) (pull_request) Failing after 26s
CI / test (3.12) (push) Failing after 15s
CI / test (3.11) (pull_request) Failing after 15s
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. |
||
|
|
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.13) (pull_request) Successful in 40s
CI / test (3.12) (push) Successful in 38s
CI / test (3.11) (pull_request) Successful in 28s
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. |
||
|
|
a0e70d1686 | Merge pull request 'feat: the configuration that says which services run together (4.17.0)' (#47) from feat/service-clusters into main | ||
|
|
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.13) (pull_request) Successful in 26s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 25s
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".
|
||
|
|
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.13) (pull_request) Successful in 26s
CI / test (3.12) (push) Successful in 30s
CI / test (3.11) (pull_request) Successful in 25s
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. |
||
|
|
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.13) (pull_request) Successful in 25s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 24s
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.
|
||
|
|
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.13) (pull_request) Successful in 32s
CI / test (3.12) (push) Successful in 36s
CI / test (3.11) (pull_request) Successful in 30s
|
||
|
|
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.13) (pull_request) Successful in 32s
CI / test (3.12) (push) Successful in 29s
CI / test (3.11) (pull_request) Successful in 26s
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). |
||
|
|
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.13) (pull_request) Successful in 29s
CI / test (3.12) (push) Successful in 35s
CI / test (3.11) (pull_request) Successful in 27s
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. |
||
|
|
9324a5b8f1 |
feat: fix routines as templates with the caller's values; deprecate run_device_action (4.13.0)
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 31s
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 28s
CI / test (3.13) (pull_request) Successful in 27s
CI / test (3.12) (push) Successful in 31s
CI / test (3.11) (pull_request) Successful in 28s
run_device_action was a string dispatch drivers filled with an application's remediations, values hard-coded inside (community "public", the caller's address, a /24 firewall rule). napalm_device_types.fixes declares them as templates instead. A template runs declared steps in order and stops at the first failure (run_fix_steps); the driver implements the steps, or overrides the whole method where its device takes the change in one call; every value comes from the caller. - SnmpAgentMixin.configure_snmp_agent(settings): install, configure, firewall, start. The caller verifies with its own SNMP client. get_management_peer() (optional) says the address the device sees the management connection come from, for choosing allowed_sources. - EnsurePackageMixin.ensure_package(name): install only what is missing. - PackageProxyMixin.configure_package_proxy(url): declared. - ContainerEngineMixin.grant_container_engine_access(user): declared. None is mixed into a role base, so a capability check stays truthful. Closes #33 |
||
|
|
b4c4ec0b0b |
feat: SnmpHealthProfile, the OIDs a driver declares; deprecate HealthMetricsMixin (4.12.0)
CI / test (3.10) (push) Successful in 28s
CI / test (3.11) (push) Successful in 27s
CI / test (3.13) (push) Successful in 30s
CI / test (3.10) (pull_request) Successful in 29s
CI / test (3.12) (pull_request) Successful in 35s
CI / test (3.13) (pull_request) Successful in 33s
CI / test (3.12) (push) Successful in 29s
CI / test (3.11) (pull_request) Successful in 26s
Drivers no longer collect over SNMP (docs/STRUCTURE.md). A driver whose device publishes its health values under OIDs of its own declares them as SNMP_HEALTH_PROFILE: per value either scalars asked in order or a table folded by first, average or max, optionally with a pattern for text answers; memory as total with used or free, or a percentage, in KiB or bytes; and how to read the interfaces. The application polls and computes. HealthMetricsMixin.get_health_metrics now warns that it is deprecated; it goes in 5.0. Closes #32 |
||
|
|
90367c1370 |
feat: an HA pair's DHCP peers and config sync as facts (4.11.0)
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.13) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.13) (pull_request) Successful in 25s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 24s
get_dhcp_ha (declared on DhcpServerMixin, optional) is what a DHCP server's own HA configuration says: on or off, this server's peer name, each peer's name, role as the server words it, and HA URL. ConfigSyncMixin.get_config_sync is where a host pushes its configuration and for which services, by the names get_services reports; sync items without a service name stay visible under `unmapped`. A driver mixes it in, no role promises it. Both raise when they could not read. What the facts mean for a pair -- hot standby, which side to write to -- is the caller's (NetOrk/netork#1125). |
||
|
|
0330f17a67 |
fix: keep CARP state knowledge out of the base package (4.10.1)
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 24s
CI / test (3.13) (push) Successful in 25s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 26s
CI / test (3.13) (pull_request) Successful in 26s
CI / test (3.12) (push) Successful in 26s
CI / test (3.11) (pull_request) Successful in 24s
carp_virtual_ip() and its state table are CARP protocol knowledge; under the agreed structure (PR #37, docs/STRUCTURE.md) the base package carries only contracts, data shapes and I/O-free reconcilers. They move to the driver that speaks CARP (napalm-opnsense). The contract stays: VirtualIpsDict.carp and VirtualIpDict.holds. Nothing used the helper yet; it was released in 4.10.0 an hour ago. netOrk #1121. |
||
|
|
4f3b88db0e |
feat: CARP addresses as virtual IPs, with their holder in the reading (4.10.0)
CI / test (3.10) (push) Successful in 27s
CI / test (3.11) (push) Successful in 24s
CI / test (3.13) (push) Successful in 25s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 26s
CI / test (3.13) (pull_request) Successful in 26s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 24s
A firewall pair's CARP addresses are a third virtual IP mechanism. Unlike vip-manager and keepalived, a CARP reading says who holds the address: a firewall's interface list need not show it, but CARP's state names the MASTER. - VirtualIpsDict gains carp (NotRequired), VirtualIpDict gains holds (NotRequired; None leaves the holder to the interfaces). - carp_virtual_ip() shapes one address bound to a VHID: MASTER holds, BACKUP stands by, INIT and DISABLED neither run nor hold, an unknown state says nothing. The same for OPNsense and pfSense; a driver supplies the fields. netOrk #1121. |
||
|
|
fde6d717a8 |
feat: SystemIdentityMixin reads a host's SMBIOS identity (4.9.0)
What ties a server to its BMC: the BMC reports the server's serial number and system UUID, the host reads the same values from its DMI tables. Both drivers that read DMI (napalm-linux, napalm-proxmox) had a copy of the shell for it, and neither read the board serial. SystemIdentityMixin.get_system_identity() reads product_uuid, product_serial and board_serial in one framed command and returns them with vendor placeholders empty: a Supermicro board's product serial is 0123456789 on every one of them, others read "To be filled by O.E.M." or "Default string", and many cheap boards share the UUID 03000200-0400-0500-0006-000700080009. is_placeholder_identity() is the same filter for a BMC driver's side. A driver supplies only _run_system_identity_command(command, privileged=); the files are root's. |
||
|
|
a1da0337e2 |
feat: alternative fingerprint rules count once (4.8.0)
Discovery compares drivers by score divided by the most a driver could score, and that maximum summed every positive rule. Rules that never match together, such as one vendor's landing page or another's, made a driver that knows several vendors lose to one that knows none: napalm-redfish's Supermicro landing page scored 6 of 41 and lost to a bare "linux" in the same BMC's SNMP sysDescr, 5 of 18. FingerprintRule gets an optional group. rules_max_weight() sums the positive rules and counts each group once, with its strongest rule. Existing rules have no group and count as before. |
||
|
|
7afa590c0c |
fix: ship py.typed so type checkers read the package's types
The package declares "Typing :: Typed" but shipped no PEP 561 marker, so mypy in driver repositories treated it as untyped. Add the marker, include it as package data, and release 4.7.1. |
||
|
|
155b5bbbe4 |
feat!: settle the open review questions; release 4.7.0
## feat!: settle the open review questions on roles, diffs, SSH and SNMP - roles: a driver that sets ROLE itself replaces the role it inherits, so a Windows driver on OSDriver is "windows", not also "linux". - os: OSDriver's account listing is get_os_users; NAPALM's get_users has another shape and a runtime stub, so hasattr could not tell. - README: NAPALM's own getters must come from the driver or a mixin listed before the first role base; its stubs win the MRO otherwise. - firewall/DHCP diffs: an empty key, a key given twice, or one more than one live entry holds raises ValueError instead of overwriting by guess; live entries without a key are never matched. - ssh_server: only host key algorithms the host has a key for count as staying; when the keys cannot be read, the host key list is not touched. sshd_config and its copy keep their file mode (GNU and BSD stat), 644 only for a new file. - SNMP: 64-bit ifXTable octets and ifHighSpeed, with the 32-bit counters as fallback for agents without ifXTable. - pyproject: declare typing-extensions, which models.py imports. BREAKING CHANGE: OSDriver.get_users is now get_os_users; diffs raise ValueError on keys that cannot name one entry; plan_ssh_hardening removes no host key algorithm without host_keys. ## fix: tell "could not read" and "does not install" apart in update and VIP readers - package_updates: the dnf security reader records dnf's exit status and raises when it is missing or non-zero, as the apt reader does; a failed dnf no longer reads as "no security advisories". - host_status: an enabled dnf-automatic.timer counts as auto updates only with apply_updates = yes (dnf5's automatic.conf wins over dnf4's); dnf-automatic-install.timer always does. Unattended-upgrades counts only while the program is installed, not from a conffile left behind. - virtual_ips: a host with systemctl but without systemd as PID 1 reads as "did not look" (None), not as "has none". keepalived blocks whose brace is on the next line are read. BREAKING CHANGE: parse_dnf_security expects DNF_SECURITY_COMMAND's __DNF_RC marker and raises ValueError without it. |
||
|
|
e509445572 |
feat: add ManagementControllerDriver for server BMCs
A role base for baseboard management controllers (Supermicro, Dell iDRAC, HPE iLO, Lenovo XCC), reached over Redfish or IPMI, not SSH. It declares, under TYPE_CHECKING only: get_power_state, set_power_state (Redfish ResetType actions), get_hardware_inventory (CPUs, DIMMs, drives, PSUs, NICs, and the server's serial, system UUID and NIC MACs), get_event_log, get_firmware_inventory and get_management_protocols. reboot_host restarts the BMC itself (Manager.Reset), never the managed server, which goes through set_power_state. No HealthMetricsMixin and no command channel; sensors come through NAPALM's get_environment. |
||
|
|
dd8977750d |
chore: Python 3.13, mypy --strict in CI, eight bug fixes, docs
Squashes three changes: ## chore: support Python 3.13 and make mypy --strict pass in CI Add 3.13 to the CI matrix and classifiers, run mypy in CI, fix the 14 strict errors it reported, and correct the README's minimum Python. ## fix: eight bugs found in a full review, each with a regression test - channel: run_on_transport lost output sshd sent after the exit status; it now reads stdout and stderr to EOF before returning. - ssh_server: a failed way back (restore or reload) raised out of harden_ssh_server after the host was touched; it is now reported in the result, with rolled_back False. - host_status: a newer RPM kernel (RHEL, Fedora) was never seen, because its release, not its arch, followed the last "-". - package_updates: an apt line wrapped at a blank lost the blank, and with it the package. - kernel: an empty payload (gzip or base64 missing) read as a report. - listening: "[fe80::1]%eth0:546", as ss prints it, kept its brackets. - ping_sweep: a reply whose "success" was not a dict aborted the sweep. - lag: a member of unknown speed (-1) lowered the LAG's speed. ## docs: bring the README and docstrings in line with the code The firewall worked example showed the runtime stubs the README forbids; the class table missed PhoneDriver and MediaDriver; ConfigLifecycleMixin is mixed in by drivers, not by a role base; services, mac_acl and packages named a class, a key and an exception that do not exist. |
||
|
|
7ec427c743 |
fix: never let root read the SSH configuration from stdin
CI / test (3.10) (push) Successful in 23s
CI / test (3.11) (push) Successful in 22s
CI / test (3.10) (pull_request) Successful in 23s
CI / test (3.12) (pull_request) Successful in 24s
CI / test (3.12) (push) Successful in 24s
CI / test (3.11) (pull_request) Successful in 25s
A driver gains root with sudo -S and puts the password in front of stdin. A sudo that does not prompt -- NOPASSWD, a cached timestamp -- leaves it there, and the cat under sudo wrote it into the drop-in as its first line. Seen on the first real run (NetOrk/netork#1027): sshd -t rejected the file and the rollback removed it, but the password was in a 0644 file for a moment and in the error the caller showed. The content now goes without privilege to a mktemp file only the login user can read; root installs that file (mode 644, root-owned) and removes it. The fake host in the tests prepends the password to every privileged stdin, as a non-prompting sudo does. Bumps to 4.5.1. NetOrk/netork#1027, NetOrk/netork#1029 |
||
|
|
23c352aa8a |
feat: OpenSshServerMixin takes flagged algorithms out of what sshd offers
CI / test (3.10) (push) Successful in 23s
CI / test (3.11) (push) Successful in 22s
CI / test (3.10) (pull_request) Successful in 23s
CI / test (3.12) (pull_request) Successful in 23s
CI / test (3.12) (push) Successful in 23s
CI / test (3.11) (pull_request) Successful in 22s
ssh-audit names algorithms an SSH server should stop offering. Taking them out is the same on every OpenSSH host, so it lives here once: a driver mixes in OpenSshServerMixin and supplies run_command. harden_ssh_server reads the lists sshd really uses (sshd -T), removes the requested algorithms and writes the rest to /etc/ssh/sshd_config.d/00-netork-ssh-hardening.conf -- or, where sshd_config has no Include of that directory, rewrites sshd_config after a copy. It never removes the last algorithm of a list, nor, given the managing client's lists, the last one that client speaks. sshd -t must accept the result and sshd -T must show it; after the reload the caller's verify opens a new session, and if that fails the still-open one puts the previous state back and reloads again. Bumps to 4.5.0. NetOrk/netork#1027 |