get_login_accounts reads the host's own accounts (Get-LocalUser), their last login and failed attempts from the account database, expiry and lock, and whether each is an administrator (S-1-5-32-544, by SID) or may log in over Remote Desktop (the logon right and its denial from secedit, the host's fDenyTSConnections). groups lists the groups that grant either, with every member, a domain's included. uid is the RID, sid the SID. A domain controller's accounts are not read. get_login_sessions reads logon events 4624 of type 2, 10 and 11 of the last seven days from the Security log, ended by 4634/4647, an administrator's two linked logons as one session. own_address is the reading's own WinRM logon's address; records_since the log's oldest event. A log without any logon raises LoginSessionsUnavailable. Both scripts are in tools/harvest.py.
6.3 KiB
6.3 KiB
Changelog
All notable changes to this driver. The format follows Keep a Changelog, versions follow Semantic Versioning.
[Unreleased]
Added
- 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.
- 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.