driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Failing after 18s
driver / types (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m10s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Failing after 2m21s
driver / publish (pull_request) Skipped
get_web_login_auth() names the auth servers <system><webgui><authmode> tries, in order (the Local Database when it names none), each with what it asks for: password for local, ldap and voucher, password_otp for totp and ldap-totp, external for radius, unknown otherwise. A name no server has is skipped, as OPNsense skips it. get_ssh_server_auth() reads <system><ssh> as openssh_configure_do writes sshd_config: on only with enabled, password and challenge-response login with passwordauth, root with permitrootlogin, a key always. An SSH password goes through the same servers (password_sources). Needs napalm-device-types 4.50.0.
9.4 KiB
9.4 KiB
Changelog
All notable changes to this driver. The format follows Keep a Changelog, versions follow Semantic Versioning.
[Unreleased]
Added
- How people log in (NetOrk/netork#662), in napalm-device-types 4.50.0's shapes, read from
config.xml over
/api/core/backup/download/this.get_web_login_auth()returns the auth servers<system><webgui><authmode>names, in their order, and the Local Database when it names none. Each server comes with what it asks for:passwordforlocal,ldapandvoucher,password_otpfortotpandldap-totp,externalforradius, andunknownfor any other type. A name no server has is skipped, as OPNsense skips it.get_ssh_server_auth()returns sshd's settings asopenssh_configure_dowrites them:server_enabledfromenabled, password and challenge-response login frompasswordauth, and root login frompermitrootlogin, each tested for presence as OPNsense does. A key is always on.password_sourceslists the same servers, because an SSH password goes through them. - The firewall's configuration history (NetOrk/netork#2511):
get_config_revisions()lists the revisions OPNsense keeps of config.xml, newest first, each with its id, its time in UTC, its description, its user and its size;get_config_revision(id)returns one revision's config.xml;revert_config_revision(id)makes it the configuration again through/api/core/backup/revert_backup, refuses an id that is not in the history (UnknownConfigRevision), and raisesConfigRevertFailedwhen the newest revision afterwards does not hold the revision's configuration -- OPNsense answers "reverted" even when it kept the previous file.config_revision_content()compares config.xml without the<revision>block every save writes. The contract is napalm-device-types 4.38.0'sConfigRevisionsMixin. A revert saves config.xml and nothing else: no service is reloaded and the firewall does not reboot. - Time sync (NetOrk/netork#2363):
get_time_sync()from napalm-device-types 4.35.0'sTimeSyncMixinreads the time servers (<system><timeservers>, in their order) and the zone (<system><timezone>, an IANA name; none is theEtc/UTCOPNsense runs then) from config.xml over/api/core/backup/download/this, and whether ntpd follows a system peer from/api/ntpd/service/status. Both values are set on legacy pages that no API controller reads or writes, up to 26.7 and onmaster, so the driver writes neither:time_sync_writesis empty,configure_time_syncis None, andTIME_SERVERS_MENU(Services → Network Time → General) andTIME_ZONE_MENU(System → Settings → General) say where a person sets them.
Changed
- Requires napalm-device-types 4.35.0, which declares the time-sync contract.
- Requires napalm-device-types 4.38.0, which declares the configuration-history contract.
load_replace_candidateisNoneinstead of NAPALM's stub that raised, so a caller can tell that the driver replaces no configuration: OPNsense has no API that takes an uploaded config.xml.
Fixed
get_radius_clients()andget_radius_users()raise when the firewall does not answer or the answer holds norows, instead of returning[], so an empty list means FreeRADIUS has none (#49).RADIUS_READS_RAISE = Trueon the driver says so. A saved add whose id lookup fails still answerssuccess, with no id.get_ntp_servers()lists the configured servers of config.xml, the same list asget_time_sync(). It read apeersfield/api/ntpd/service/statusdoes not have -- the endpoint answers with ntpq's associations asrows-- and so found no server. A failed read now raises instead of reading as "no servers".
[0.6.0] - 2026-11-07
Added
- Where the SSH server's algorithm lists are set (NetOrk/netork#1769):
SSH_SETTINGS_MENU(System → Settings → Administration → Secure Shell) andSSH_SETTINGS_FIELDS, each list's field by its algorithm class. OPNsense writes sshd_config from config.xml and has no API for that section, so the driver does not harden the SSH server itself; an application tells a person what to set there. - Scheduled jobs (NetOrk/netork#1933, #43):
get_scheduled_jobs()reads every cron job of config.xml over/api/cron/settings/get, with who owns it -- another component's job isplatform, one written byput_scheduled_job()application, the restadmin.manage_scheduled_job()enables and disables any of them;put_scheduled_job()anddelete_scheduled_job()write and remove an application's own, whose command is a configd action.get_scheduled_job_commands()lists the actions configd offers. Running a job now is refused: the API cannot run a configd action. Every write reads the job again first and refuses one that changed.
Changed
- Requires napalm-device-types 4.26.0, which declares the scheduled-jobs contract.
- 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 is 5.1: older releases import
pkg_resources, which a Python 3.12 venv no longer has.
Fixed
is_alive()checks the host and port named inbase_url(https://fw:8443) instead of always port 443 on the hostname, so a firewall whose API listens elsewhere no longer reads as dead (#15).sync_dns_zone()andget_dns_entries()raise when the host overrides cannot be read. A transient API error used to read as "no overrides": the sync then deleted nothing and added every record a second time (#14).create_dhcp_reservation()no longer takes over a Kea reservation another MAC holds for the address (made by hand, say): it raisesRuntimeErrorand leaves it as it is.delete_dhcp_reservation_and_lease()removes only the reservation and lease of the given MAC and reports another host's reservation for the address in the newreservation_other_macfield (#26).configure_snmp_agent()works on OPNsense 26.x again. The configure step sent fields the os-net-snmp model does not have (contact,location,sysobjid,bindip) andlistenin the shapegetreturns rather than as a string, which 26.x refuses with HTTP 500. It now sendssyscontact/syslocation, and only when the caller gives them, so an operator's sysContact and sysLocation are no longer blanked (#36).get_arp_table()andget_ipv6_neighbors_table()report an unknown age as-1.0(napalm-device-types'ARP_AGE_UNKNOWN). They reportedexpires, the seconds left until the entry expires, which is no age: an entry refreshed a second ago looked 20 minutes old (NetOrk/netork#1327).get_vpn_tunnels()keys a WireGuard peer by its interface and the start of its public key (wireguard-wg0-aBcD1234, URL-safe) instead of its position, so a peer added ahead of another no longer renumbers it (#32). Every WireGuard key changes once with this release.get_dns_entries()raises when the service list (/api/core/service/search) cannot be read, instead of returning an empty list as if neither Unbound nor Dnsmasq ran: a transient API error made the firewall look as if it had no DNS records.sync_dns_zone()raises that API error instead of "No active DNS service (Unbound or Dnsmasq) detected" (#39).create_dhcp_reservation()raisesRuntimeErrornamingsearchReservationwhen the search for an existing reservation fails, and writes nothing. It used to add the reservation anyway: a retry then failed with "Kea rejected DHCP reservation" instead of the real error, or left two reservations for one address, which Kea refuses to load (#40).- The unit tests no longer reach the network: the test of a failed
open()looked up a real host name and waited for the resolver, so it hung or behaved differently on a build host with a slow resolver or one that answers every name (#41).
[0.5.0] - 2026-10-23
The first release on PyPI.
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.typedand a LICENSE file. Python 3.10 remains the floor. Requires napalm-device-types 4.21.1.
Fixed
get_dhcp_leases()raises when Kea, ISC DHCP and the ARP fallback all failed, instead of returning an empty list that looks like a server without leases (#27).create_dhcp_reservation()leaves a reservation that already holds what was asked alone, and does not reconfigure (restart) Kea for it.
[0.4.0] - 2026-10-18
Added
- napalm-device-types 4.17's public contracts:
apply_updates()passes the packages it is given andget_update_progress()reports the upgrade's state and log;get_dns_forwards(),set_dns_forward()andremove_dns_forward()for Unbound;get_ospf(). Requires napalm-device-types 4.17.0.
[0.3.0] - 2026-10-17
Removed
- Breaking:
get_device_warnings(). The pending updates are inget_available_updates().
[0.2.0] - 2026-10-17
Changed
- Breaking:
run_device_actionis removed. The SNMP agent is set up through napalm-device-types 4.13'sconfigure_snmp_agentwith the caller's community, contact, location and listen address, and the firewall opens UDP/161 only to the allowed sources (#13).