# Conflicts: # CHANGELOG.md # README.md # napalm_windows/windows.py # tools/harvest.py
14 KiB
14 KiB
Changelog
All notable changes to this driver. The format follows Keep a Changelog, versions follow Semantic Versioning.
[Unreleased]
Added
- Disks, pools, volumes and drive health without smartctl (NetOrk/netork#2896), through
napalm-device-types'
HostStorageMixin, so the host stays a host.get_disksreadsGet-PhysicalDisk(model, serial, medium, NVMe, Windows' health, the Storage Spaces pool a disk is in);get_disk_smartreadsGet-StorageReliabilityCounterper disk (temperature, wear, power-on hours, uncorrected read and write errors);get_disk_poolsreads Storage Spaces' pools;get_volumesthe fixed volumes mounted at a drive letter or in a folder, with file system and health. A disk whose counter cannot be read -- the cmdlet needs an administrator, and virtual disks often have none -- has no drive health rather than an error; a virtual disk or a RAID controller's logical disk reads temperature -1 and health "unknown" instead of zeros and a "healthy" nobody measured. A Storage Spaces virtual disk is not listed as a physical disk. - The host's SMBIOS identity, what ties it to its BMC (NetOrk/netork#2888):
get_system_identityreads the system UUID and product serial (Win32_ComputerSystemProduct), the board serial (Win32_BaseBoard) and the system firmware's vendor, version and release date (Win32_BIOS) in one script of its own. Vendor placeholders such as "To be filled by O.E.M." or an all-F UUID read as empty, by napalm-device-types' rules (clean_system_identity). - Running processes (NetOrk/netork#2889):
get_processeslists them the waypsdoes -- parent, owner, CPU and memory share, virtual and resident size, start and command line -- fromWin32_ProcessandGet-Process -IncludeUserNamein one script. A process that exited between the two reads, or whose PID was reused in between, is left out. - Local accounts (NetOrk/netork#2889):
get_os_userslists the host's own accounts with their local groups and profile folder.uidis the account's relative identifier (500 for the built-in Administrator),sidits whole security identifier. A domain controller, which has no local accounts, and a host without the LocalAccounts cmdlets raiseNotImplementedError. - Installed software (NetOrk/netork#2890):
get_packageslists the programs installed for the whole machine from the Uninstall keys, the 64-bit and the 32-bit ones, each with its publisher and architecture;sourceismsiorexe. Hidden system components and updates listed under their product are left out. Programs installed for one user only, and Store apps, are not read yet; nothing is installed or removed. - Restart required and automatic updates (NetOrk/netork#2891):
get_host_statussays the host needs a restart when Windows Update or component servicing waits for one; pending file renames, a pending update executable and a new computer name are named in the reason but do not count on their own. Automatic updates follow the Windows Update policy (NoAutoUpdate,AUOptions); without one a Windows client installs on its own and a server follows its local setting. When they last succeeded is the latest successful installation Windows Update recorded; the system drive's size and free space come with it. Nothing searches for updates during the reading. - Who can log in to the host and who did, for the access review (NetOrk/netork#2895):
napalm-device-types'
get_login_accountsandget_login_sessions.get_login_accountslists the host's own accounts (Get-LocalUser) with their last login and failed attempts since it from the account database (sourcesam), password and account expiry, and whether each is locked (disabled, expired or locked out). Each says whether it is an administrator and whether it may log in over Remote Desktop: found by SID, so a German "Administratoren" counts, and from the Remote Desktop logon right and its denial (secedit /export) with the host's Remote Desktop setting.groupslists the groups granting either, with every member, a domain's groups and accounts by name.uidis the RID,sidthe SID. A domain controller's accounts are the directory's and are not listed.get_login_sessionslists the console and Remote Desktop logons of the last seven days from the Security log, each with its account, address, start and end; never a network logon, so neither the driver's own WinRM connection nor SMB access shows.records_sincesays how far back the log reaches, and a host that does not audit logons raisesLoginSessionsUnavailablerather than reporting nobody.
- The host firewall (NetOrk/netork#2894):
get_host_firewallreturns the Windows Firewall underwindows(napalm-device-types'WindowsFirewallDict), withsources["windows-firewall"]and no netfilter chains. It reads the three profiles as the firewall applies them (on or off, default inbound and outbound action, "block all incoming connections", whether local rules apply), every enabled rule of the active policy with its ports, addresses, program, service, interfaces and where it comes from (group policy included), and the profile each connected interface is in. The filters are read in bulk, one cmdlet per kind, so a host with hundreds of rules answers in one script rather than one query per rule. Nothing is written. - Windows features (NetOrk/netork#2898):
get_windows_featureslists every optional feature of the host's image with its state (enabled, disabled, absent, unknown) fromWin32_OptionalFeature, under the names Windows uses on clients and servers alike (SMB1Protocol,MSMQ-Server,IIS-WebServerRole,Microsoft-Hyper-V). It is what a CVE that needs a role or feature is held against. - What the event log recorded that says something is wrong with the host
(NetOrk/netork#2897):
get_host_events(since=None), napalm-device-types'HostEventsMixin. Unexpected shutdowns (Kernel-Power 41, EventLog 6008), bugchecks with their stop code (1001), fatal and corrected hardware errors (WHEA-Logger 18, 19, 47), disk and file system errors (disk 7 and 153, Ntfs 55), crashing programs (Application Error 1000) and services that ended unexpectedly (Service Control Manager 7031, 7034), over the last seven days by default, in one script of three queries bounded by time and count. An empty log is no events, not an error (NoMatchingEventsFoundis caught); a query that fails names its kindsunread. - The event channels as the host's log sources:
get_log_sources()lists every channel that is switched on and holds records as a source of kindeventlog, named by its channel, with its.evtxfile, size and last write (Get-WinEvent -ListLog *). Analytic and debug channels are left out. get_services()says how each service's last run ended (result,exit_code, fromWin32_Service.ExitCodeandServiceSpecificExitCode), whether a trigger starts it (trigger_start) and the account it runs as (account), so that an automatic service that died is told from one stopped on purpose. It moves intoWindowsServicesMixin.- Repair runs (NetOrk/netork#2899), napalm-device-types'
HostRepairMixin: checking the system files (sfc /verifyonly) and the component store (DISM /ScanHealth), updating Microsoft Defender's signatures and running a quick or full Defender scan. Each streams the tool's output line by line as the host prints it and ends with the tool's exit code; a failure names the tool's last lines. Each run has its own bound in time, which a caller'slimitcan tighten. A host without Defender says so instead of failing with an error. Repairing the system files or the component store is not offered yet: both wait for a test on a real host.PsrpTransport.run_streaming(script, on_output, limit=...)runs a long script, passing each output line on as it arrives and stopping it past its limit. - Windows Update (NetOrk/netork#2892). A refresh searches the update source the host is configured for (Windows Update or its WSUS server) and keeps what it found on the host; the pending updates are read from that, so a poll never waits minutes for a search. Each pending update carries its title, KB articles, the CVEs it fixes and Microsoft's severity rating, and is named so that next month's cumulative update keeps the same name. Optional previews, feature upgrades and drivers are left out.
- Installing Windows updates (NetOrk/netork#2892): Windows does not let a remote session install updates, so each run is a one-shot task running as SYSTEM. It installs only the exact updates chosen, refuses one that is no longer offered, asks for input or has licence terms not yet accepted, installs nothing while a restart is pending, and never restarts the host. Its output arrives line by line; the task is deleted afterwards.
- The update history: what Windows Update installed or removed, when, which component asked for it, and why it failed.
- Restarting and shutting the host down (NetOrk/netork#2841):
reboot_host()andshutdown_host()from napalm-device-types'HostRebootMixinandHostShutdownMixinrunRestart-ComputerandStop-Computerover the PSRP connection, neither with-Force: Windows asks running programs to close and refuses while other users are logged on, a disconnected session included, instead of throwing away what they have not saved. A refusal raisesRuntimeErrorwith the host's answer. Both cmdlets start the shutdown and return, so no delay is needed before the session goes; a connection the host drops before answering counts as accepted.PsrpTransport.run_last(script)tells the two apart:Falsewhen the connection broke,PowerShellErrorwhen the script wrote an error. - Time sync: napalm-device-types'
TimeSyncMixin(4.35.0), servers and zone (NetOrk/netork#2367).get_time_syncreads w32time'sNtpServerandTypefrom the registry (group policy's first;NoSynchas no servers), whether the clock is synchronised (the leap indicator ofw32tm /query /status) and the zone, in one script.configure_time_syncwrites the servers as<server>,0x8withType NTPandw32tm /config /update, starting a stopped Windows Time service, and the zone withSet-TimeZone. A domain member that takes its time from the domain hierarchy (NT5DS,AllSync) reports its configured servers and refuses the write, as does a host whose w32time settings come from group policy. The IANA name written is kept inHKLM\SOFTWARE\napalm-windowsso it reads back as written; writes the host already has are skipped. - The time zone table is CLDR's
windowsZones.xml(release 49), generated intonapalm_windows/_windows_zones.pybytools/windows_zones.pywith tzdata's links, both ways: every Windows zone reads as an IANA name, not only the common ones, and every IANA zone CLDR maps has its Windows zone. - Scheduled jobs: the Task Scheduler as napalm-device-types'
ScheduledJobsMixin(#8).get_scheduled_jobsreads every task with its last and next run in one script (Get-ScheduledTask,Get-ScheduledTaskInfo) astask:<path><name>: a task under\Microsoft\is theplatform's, any other theadmin's, and a task in the root folder whose description starts withnapalm-scheduled-job: <name>anapplication's. The time zone comes as an IANA name for the common Windows zones, elseNone.manage_scheduled_jobenables, disables (Enable-/Disable-ScheduledTask) or starts one (Start-ScheduledTask, which returns once the task has started).put_scheduled_jobregisters an application's task\<name>from XML: the command runs incmd.exe /d /s /c,SYSTEMor a local user without a stored password (S4U), and the cron expression becomes triggers where Task Scheduler can express it exactly; any other shape is refused, naming why.delete_scheduled_jobunregisters it. Every write reads the task again first and refuses over a change it did not see. Fixture synthetic.
Changed
- The floor on napalm-device-types is 4.35.0, which declares the time sync 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
get_arp_table()reports an unknown age as-1.0(napalm-device-types'ARP_AGE_UNKNOWN) instead of0.0, which means "confirmed just now":Get-NetNeighborhas a state but no age (NetOrk/netork#1327).
[0.2.0] - 2026-10-23
The first release on PyPI.
Added
- PowerShell Remoting transport over WinRM (pypsrp), one runspace pool per connection.
get_facts,get_interfaces,get_interfaces_ip,get_arp_table,get_route_to.get_servicesandmanage_service(start, stop, restart, enable, disable).get_listening_sockets: every listening TCP and bound UDP socket with its process and, where the process runs one Windows service, that service (netOrk #673). Fixture synthetic.- Discovery fingerprints: WinRM ports 5985/5986,
Microsoft-HTTPAPI/Microsoft-IISserver headers, Windows SNMPsysDescr, OpenSSH-for-Windows banner. tools/harvest.pyto record real script output as test fixtures.
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.9 is no longer supported; napalm-device-types never ran on it, and 4.21.1 from PyPI is now the oldest it accepts.