# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Added - `get_time_sync()` and `configure_time_sync()` through napalm-device-types' `PosixTimeSyncMixin` (4.35.0): the host's NTP servers in its client's order, its time zone, whether the clock is synchronised and which client keeps it (chrony, systemd-timesyncd, ntpd, OpenNTPD), read in one round trip as the login user. The zone is set with `timedatectl set-timezone`; chrony's servers go to `/etc/chrony/sources.d/netork.sources` (else a `confdir` or an included file) with every other source commented out, systemd-timesyncd's to `/etc/systemd/timesyncd.conf.d/netork.conf`. The host ends up with exactly the servers given (NetOrk/netork#2361). OpenMediaVault and QNAP inherit it. - `get_running_backups()` through napalm-device-types' `RunningBackupsMixin` (4.34.0): the host's own backups a restart would abort -- a process of restic, resticprofile, autorestic, borg, borgmatic, duplicity, duply, rsnapshot, rdiff-backup, proxmox-backup-client, kopia or btrbk doing a backup, prune, check or copy (not a mount, a restore or a listing), with the systemd service it runs in as its job (a timer's service; none for a cron or a login session), its process id and when it started. One round trip as the login user; a `ps` without `etimes` fails the reading (NetOrk/netork#2318). OpenMediaVault and QNAP inherit it. - `get_log_sources()` through napalm-device-types' `LogSourcesMixin` (4.30.0): the units journald holds entries for and the log files running processes hold open, with the service or container writing each, as root, and without root what the login user may see (NetOrk/netork#2049). OpenMediaVault and QNAP inherit it. - A deleted key can take the password with it (NetOrk/netork#2033): through napalm-device-types' `remove_local_account_keys(..., clear_password=True)` the keys go as the person, the password goes (`usermod -p '*'`), and so do the sudo rule and the admin groups. The account stays open and logs in with its other keys only. ### Changed - Needs napalm-device-types 4.35.0. ## [0.17.0] - 2026-11-04 ### Added - Personal accounts follow what the person changes (NetOrk/netork#2013): `add_local_account(..., replaces=[...])` takes the old keys out of the account's key files as the new one goes in, `remove_local_account_keys` takes deleted keys out and leaves the account open, and `add_local_account(..., clear_password=True)` removes the password (`usermod -p '*'`): the account logs in with its key only and has no sudo. Keys the person added on the host stay. ### Changed - Needs napalm-device-types 4.28.0. ## [0.16.0] - 2026-11-03 ### Added - Scheduled jobs (NetOrk/netork#1933, #67), through napalm-device-types' `PosixScheduledJobsMixin`: `get_scheduled_jobs()` reads `/etc/crontab`, `/etc/cron.d`, the user crontabs (Debian, RHEL, Alpine), the run-parts directories, `/etc/anacrontab` and every systemd timer in one round trip as root; `manage_scheduled_job()` enables, disables or runs one now; `put_scheduled_job()` and `delete_scheduled_job()` write and remove an application's own. OpenMediaVault and QNAP QTS inherit it and decide per verb in their own packages. - netOrk's own account with a fixed uid (NetOrk/netork#1817): `_account_create_with_uid` makes it with `useradd -m -u `. Below `UID_MIN` useradd warns and goes on, as a system's account. - Personal accounts (NetOrk/netork#1793), through napalm-device-types' `LocalAccountsMixin`: `get_local_accounts()`, `add_local_account()` and `lock_local_account()` with shadow-utils' commands (`useradd -m -s /bin/bash`, `usermod`, `gpasswd -d`). A locked account is an expired one (`usermod -L -e 1`): PAM refuses it a key login too, where a `!` in front of the password stops only the password. Opening it again lifts the expiry and gives the old password back. Checked on Debian 13 and Rocky Linux 9 with sshd and sudo. OpenMediaVault (Debian) inherits it; QNAP QTS opts out in napalm-qnap-qts. Requires the napalm-device-types release with `LocalAccountsMixin`. - `open()` tries the connection again after 1, 3, 7 and 15 s when sshd closes it before its banner -- what OpenSSH 9.8+ does to a source it has just penalised (`PerSourcePenalties`), e.g. after a security scanner's probes. Needs napalm-device-types' `retry_refused` (NAPALM/napalm-device-types#63, NetOrk/netork#1800). - The sudo password the old `_sudo` left in shell histories (NetOrk/netork#1090), through napalm-device-types' `SudoHistoryMixin`. Until NetOrk/netork#1039 every privileged command was typed into the interactive shell as `echo '' | sudo -S -p "" …`, so the login user's history kept the password once per command. `get_history_sudo_lines()` counts those lines with `grep -c`, without reading them; `remove_history_sudo_lines()` deletes exactly them and gives `/etc/snmp/snmpd.conf` and `/etc/apt/apt.conf.d/00proxy` back to `root:root` where the old partial sudo left them to the login user (a regular file, never a symbolic link). OpenMediaVault and QNAP inherit both. Requires the napalm-device-types release with `SudoHistoryMixin`. - `set_hostname()` (#45): netOrk could save a Linux host's new name but not apply it ("The driver linux does not support set_hostname()"). The host now takes the short name through `hostnamectl`, or `/etc/hostname` and `hostname(1)` without systemd; `/etc/hosts` follows (the lines naming the old name, else the `127.0.1.1` line), and a cloud-init host gets `preserve_hostname: true` so its next boot keeps the name. Names that are not valid hostnames are refused before anything runs on the host. ### Changed - Python 3.12 is the floor (`requires-python = ">=3.12"`): netOrk runs every driver on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6). - The floor on napalm-device-types is 4.24.0, for its shared `lldpctl` parser. ### Fixed - `get_lldp_neighbors()` raises when lldpd runs but lldpctl fails (its socket out of the login's reach, a daemon restarting), with lldpctl's message, instead of reporting no neighbours (#66). A stopped lldpd is recognised as stopped: systemd's `inactive` used to pass the running check, as it contains the word "active". A host without lldpd, or with lldpd stopped, still reports no neighbours. - `get_lldp_neighbors()` lists every neighbour of a port (#58): a phone and the PC behind it, or the devices behind an unmanaged switch, used to merge into one entry and only the last one was left. A neighbour whose chassis id is a MAC address now carries it as `mac` (it never did), a port given as a MAC address or local id is reported instead of coming back empty, and an interface with a dot in its name (`eth0.100`) keeps its whole name. - `get_route_to()` reads unreachable, blackhole, prohibit and throw routes and multipath routes (#57). Their destinations came back as `unreachable/32`, `blackhole/32` or `nexthop/32`, and a multipath route as one entry without a next hop. A typed route now has its real prefix and its type in `protocol_attributes` (`{"type": "blackhole"}`), with no next hop and no outgoing interface, since it sends nothing out. A multipath route has one entry per next hop, each with its gateway and interface. A host route that FRR reports without a prefix length is a `/128` for IPv6 instead of a `/32` (#64), so it meets the kernel's route for the same host and gets FRR's protocol. - `get_route_to()` reads the next hop of an IPv4 route through an IPv6 gateway (RFC 8950, as BGP unnumbered sets up), which `ip route` prints as `via inet6 fe80::1` (#65). The next hop came back as `inet6`; it is now the address, for multipath routes too. Such a route stays `family: ipv4`: the family is the destination's, never the next hop's. - `get_available_updates()` works on dnf and yum hosts whose login user has passwordless sudo (NOPASSWD), as netOrk's own account does, and marks the security fixes there (#56). The security-advisory query did not parse under `sudo -n`, so no answer came back and the read ran into its 120 s timeout. Without a sudo password a privileged command now runs as root as a whole, in one `sh -c`, as it already did with a password; before, only its first command did. A refused sudo still reports its exit status at once. - `ping()` passes `destination` and `source` to the host's shell as one quoted word each (#55). A destination such as `192.0.2.1; id` ran the command after the `;` as the login user. `count`, `timeout`, `size` and `ttl` must be numbers; anything else raises `ValueError` before a command is sent. A destination or source that starts with `-` is refused the same way (#63): `ping` would read `-f` as its flood option, and no address or hostname starts with `-`. - dnf and yum hosts read pending updates and security advisories from the cached metadata only (`--cacheonly`), as apt reads its local index (#59). With an expired cache `check-update` downloaded the repositories' metadata first, and on an Oracle Linux host on OCI that outlasted netOrk's whole poll, every time. Refreshing stays `refresh_available_updates()` (`dnf makecache`). Without a cache the read fails at once and says to refresh the index. Requires the napalm-device-types release with NAPALM/napalm-device-types#76 for dnf's security query. - `get_arp_table()` reports an unknown age as `-1.0` (napalm-device-types' `ARP_AGE_UNKNOWN`) instead of `0.0`, which means "confirmed just now": `ip neigh` has no age, and a STALE entry may be hours old (NetOrk/netork#1327). - `install_package()` reports success by the package manager's exit status, as `uninstall_package()` already does (#4). It used to search the output for words like "failed": an install whose postinst merely mentioned a failure read as failed, and a failure that used none of the words read as success. - `get_vpn_tunnels()` makes the public-key prefix in a WireGuard peer's key URL-safe (`+` becomes `-`, `/` becomes `_`), as napalm-opnsense does (#43). A key with `/` could not be used as a URL path segment, so such a tunnel could not be edited in netOrk. The key of a peer whose first eight key characters hold `+` or `/` changes once; `public_key` is reported unchanged. - `get_processes()` reports a process's whole start time in `started` (`Tue Oct 6 08:47:15 2026`) and only the command line in `command` (#21). `started` held the weekday alone and `command` began with the rest of the date. The start time is read in the C locale, so its words are English on every host. - `get_packages()` on apt hosts no longer lists removed packages whose configuration dpkg still keeps (state `rc`) (#17). They were reported as installed: old kernels, or an agent that had been removed. A package that is held, unpacked or half-configured still counts, since its files are on disk. - `ping()` reads BusyBox's output, the `ping` on Alpine (#15). Its summary says "2 packets received", which did not match, so every target came back as an error and a LAN scan through an Alpine host found nothing. Replies to IPv6 targets, BusyBox's `seq=` replies and replies from a name (`bytes from host (address)`) now appear in `results`, BusyBox's `round-trip` line fills the RTT fields, and an iputils summary that counts errors is read as well. - `get_route_to()` reports a dual-stack host's IPv6 default route as `::/0` (#6). It came back as a second `0.0.0.0/0` with `family: ipv6`, because `ip -6 route show` calls its default route `default` as well. An IPv6 host route is now a `/128` instead of a `/32`. ### Removed - `get_cron_jobs()`: it read without root, missed other users' crontabs, `/etc/crontab`, run-parts, anacron and every systemd timer, and nothing called it. `get_scheduled_jobs()` replaces it. ## [0.15.1] - 2026-10-23 ### Fixed - Ubuntu 26.04 hosts could not be polled (#41). systemd 258's `/etc/profile.d/80-systemd-osc-context.sh` wraps every command of an interactive bash in OSC 3008 sequences, so they ended up in every value read through the shell, the prompt line with them: `os_version` grew past 255 characters. The session now unsets `PS0` and `PROMPT_COMMAND` right after switching the history off and reads its prompt anew, and `_send()` strips terminal codes from what it returns. ## [0.15.0] - 2026-10-23 The first release on PyPI. It collects everything since 0.4.0, which was the last version recorded here. ### Changed - The driver follows the NAPALM driver standard (https://git.netork.io/NAPALM/driver-standard): CI on Gitea runs ruff, mypy, the tests on Python 3.10–3.13 and at the lowest declared versions, bandit, pip-audit and a build check, and a release tag publishes to PyPI. The package now ships `py.typed` and a LICENSE file. **Python 3.9 is no longer supported**; napalm-device-types never ran on it. - Exceptions the driver deliberately ignores (the PTY width at login, closing a dead session, unreadable route lines, the snmpd.conf community and port) are now logged at debug level. ### Added - apt's proxy through napalm-device-types' `AptProxyMixin` (NetOrk/netork#1397). `get_package_proxy()` is what `apt-config dump` says, not `00proxy` alone: a proxy in `90curtin-aptproxy` or `/etc/apt/apt.conf` wins over it, and was missed. New: `get_package_proxy_report()` (every line that sets it, per-host overrides, the https sources) and `check_package_proxy(url, expect)` (a fetch with `apt-helper`, past any proxy). `configure_package_proxy(url)` now also comments out other proxy lines, reads the result back and fetches one `InRelease` through the proxy; it fails when apt still fetches elsewhere. Reads run on the exec channel. Requires napalm-device-types 4.22.0; version 0.14.0. - `get_host_firewall()` (napalm-device-types' `HostFirewallMixin`, NetOrk/netork#1344): the host's own netfilter rules — `nft -j list ruleset`, with the tables iptables manages taken from `iptables-save` — as chains and rules in one shape. Read-only, as root, on an exec channel (the nft JSON is one long line). Requires napalm-device-types 4.21.0; version 0.13.0. - `get_service_packages()` (napalm-device-types' `ServicePackagesMixin`, NetOrk/netork#1236): which installed packages each systemd service is made of — the one shipping its unit file and the one shipping its `ExecStart` binary. Read-only, on an exec channel under `sh`, without sudo. Requires napalm-device-types 4.20.0; version 0.12.0. ### Security - The SSH host key is verified (NetOrk/netork#1167). `open()` hands netmiko the key the caller expects for the port in `optional_args["ssh_host_keys"]` (as a `known_hosts` file that exists only while it connects, with `ssh_strict`), so any other key is refused before the login (`SshHostKeyMismatch`); without one netmiko accepts the first key. Every key seen goes to `optional_args["ssh_host_key_observer"]`. OpenMediaVault and QNAP get this through `LinuxDriver.open()`. Requires napalm-device-types 4.19.0; version 0.11.0. ### Changed - **Breaking:** `get_device_warnings` is gone, and with it the `apt_proxy_url` argument. The driver reports facts and the application names warnings (napalm-device-types 4.14): `get_package_proxy()` says which proxy apt fetches through; pending updates were always in `get_available_updates()`. Requires napalm-device-types 4.14.0; version 0.9.0. ### Changed - **Breaking:** `run_device_action` is gone, with `fix_snmp`, `fix_apt_proxy`, `fix_docker_permissions` and the unused `apt_update_upgrade`. The driver implements napalm-device-types 4.13's fix templates instead, and the caller supplies every value: `configure_snmp_agent(settings)` (one `rocommunity` line per allowed source, udp/161 opened in ufw or iptables for those sources only, each step judged by its exit status), `configure_package_proxy(url)`, `grant_container_engine_access(user)` and `ensure_package(name)`. No community, contact, location or address of an application is built in any more. Requires napalm-device-types 4.13.0 or later; version 0.8.0. - The sudo hint names no application's settings. ### Fixed - The type annotations resolve: `Dict`, `List` and `Optional` were used without an import (#29). ### Added - `get_system_identity()` (napalm-device-types 4.9 `SystemIdentityMixin`): the host's SMBIOS system UUID, product serial and board serial, read as root on an exec channel, vendor placeholders empty. netOrk matches a server to its BMC on these. Requires napalm-device-types 4.9.0 or later; version 0.7.0. ### Changed - Requires napalm-device-types 4.7.1 or later; version 0.6.0. - **Breaking:** `get_users()` is now `get_os_users()`, following napalm-device-types 4.7, which renamed `OSDriver.get_users` because NAPALM's own `get_users` has another shape. The return value is unchanged (a list of `UserDict`). `get_users()` is NAPALM's again and raises `NotImplementedError`. ### Fixed - Listing updates on yum hosts (RHEL 7, CentOS 7) no longer fails with napalm-device-types 4.7: its `parse_dnf_security` needs the `__DNF_RC=` line `DNF_SECURITY_COMMAND` prints, and the yum security query had none, so it raised `ValueError`. The yum query now prints that marker the same way (`{ ...; echo __DNF_RC=$?; } | cat`). A yum or dnf security query that failed, or whose output was cut short before the marker, still leaves `security` unknown (`None`) instead of reporting no advisories. ### Security - `run_command(privileged=True, stdin=...)` raises `ValueError` while a sudo password is set. `sudo -S` reads the password from stdin, and a sudo that does not prompt (NOPASSWD, a cached timestamp) left it for the command, which read it as the first line of the data: netOrk wrote it into a file that way (NetOrk/netork#1029). Stage the data without privilege and have root install that file. Without a sudo password (`sudo -n`) or for a root login, stdin still goes to the command. - The sudo password is no longer typed into the interactive shell (NetOrk/netork#1039). Every privileged command ran there as `echo '' | sudo -S -p "" `: bash kept it in its history, so each poll wrote the password into the login user's `~/.bash_history`, and while the command ran it was in the process list for every local user. Privileged commands (`_sudo`, `_sudo_status`, and `_run_privileged` with a sudo password) now run on an exec channel like `run_command(privileged=True)`: the password reaches `sudo -S` on stdin, there is no PTY to echo it, and the whole command runs as root in one `sh -c` (before, only the part up to the first `;`, `&&` or `|` did, so `mv … && chown root:root …` failed its chown). The interactive session also switches its history off before its first command (` unset HISTFILE; set +o history`). **History files written before this version may still hold the sudo password**: remove those lines from the login user's `~/.bash_history` on your hosts and consider changing the password. `_sudo_status` takes the exit status from the channel; it is `None` only when the channel closed without one. - The snmpd and apt proxy fixes no longer stage their files at a fixed path in /tmp (`/tmp/netork_snmpd.conf`, `/tmp/netork_00proxy`) and then `mv`, `chown` and `chmod` them as root. Another local user could create that path first as a symlink, for example to `/etc/shadow`, and root's `chown`/`chmod` followed it. The content now goes to a fresh `mktemp` file under `umask 077`, written without privilege, and root `install`s it as a new file owned by root (mode 644) next to the target and renames it into place (`_install_file_as_root`). Nothing runs as root when staging failed. - `get_vpn_tunnels()` without a sudo password no longer writes `wg show all dump` (which includes the interfaces' private keys) to the predictable `/tmp/.netork_wg_`; the dump comes straight from the exec channel. ## [0.4.0] – 2026-10-08 ### Added - `get_virtual_ips()` through napalm-device-types' `VirtualIpsMixin` (4.2.0): the addresses vip-manager and keepalived configuration lets float onto this host, whether or not it holds them right now (NetOrk/netork#829). The command goes on the exec channel (`run_command`): with its awk filter it is about 4 kB, past the line the PTY reliably takes. Root first, then without it. ## [0.3.0] – 2026-10-08 ### Removed - `get_docker_info()`, `get_docker_outdated()`, `reconstruct_docker_run()` and the `_docker_bin()` hook, with the image-ID helpers they used. netOrk reads and handles containers itself over the Engine API, through `open_container_engine()` (NetOrk/netork#765), and no longer calls them. `run_device_action("fix_docker_permissions")` stays: letting the login user use Docker is an OS action. ## [0.2.0] – 2026-10-07 ### Added - `run_command()` and `open_stream()`, the public command channel from napalm-device-types 2.6.0: an exec channel on the existing SSH transport, so no PTY, separate stderr and a real exit code. `privileged=True` runs as root directly, through `sudo -S` with the password on stdin (never on the command line), or through `sudo -n`, which fails instead of prompting. - `ContainerEngineMixin`: `container_engines()` and `open_container_engine()`, whose `open_api()` streams the Docker Engine API over `docker system dial-stdio` (NetOrk/netork#765). The existing Docker methods are unchanged. ### Changed - Requires napalm-device-types >= 2.6.0. ## [0.1.0] – 2026-05-29 ### Added - Initial release - `LinuxDriver` inheriting from `napalm_device_types.OSDriver` - SSH transport via Netmiko `linux` device type - Auto-detection of package manager: `apt`, `dnf`, `yum`, `apk`, `pacman` - Standard NAPALM methods: `get_facts()`, `get_interfaces()`, `get_interfaces_ip()`, `get_arp_table()`, `get_config()`, `ping()` - OS-specific methods: `get_packages()`, `get_pending_updates()`, `apply_updates()`, `get_services()`, `get_users()`, `get_processes()`, `get_cron_jobs()` - `apply_updates()` validates all package names against `^[a-zA-Z0-9_\-\+\.]+$` to prevent shell injection before passing them to the package manager - SysV fallback for `get_services()` on non-systemd systems - Unit tests with mocked SSH connections [Unreleased]: https://github.com/chrismanivong/napalm-linux/compare/v0.1.0...HEAD [0.1.0]: https://github.com/chrismanivong/napalm-linux/releases/tag/v0.1.0