Skip to main content

napalm-windows

NAPALM driver for Windows Server 2016+ and Windows 10/11, part of the netOrk driver family built on napalm-device-types.

Driver name: windows · Role: OSDriver · Transport: PowerShell Remoting (PSRP) over WinRM via pypsrp.

Tested against

Not recorded yet: the fixtures under tests/fixtures/synthetic/ are the JSON the scripts are designed to emit, not output recorded from a host.

Install

pip install napalm-windows

How it works

Every getter sends one PowerShell script. The script projects the cmdlet results onto flat, primitive fields and ends in ConvertTo-Json, so the Python side parses JSON, never text. All device I/O goes through a single seam (PsrpTransport.run(script) -> str), which is what the tests replace.

One runspace pool stays open per connection, so a poll pays the WinRM handshake once.

Supported

Method Source
get_facts Win32_ComputerSystem, Win32_OperatingSystem, Win32_BIOS, registry (DisplayVersion, UBR)
get_interfaces Get-NetAdapter
get_interfaces_ip Get-NetIPAddress (loopback dropped, IPv6 zone index stripped)
get_arp_table Get-NetNeighbor -AddressFamily IPv4 (broadcast, multicast, unreachable dropped)
get_route_to Get-NetRoute (multicast, broadcast, loopback dropped)
get_services / manage_service Win32_Service, Start-/Stop-/Restart-Service, Set-Service -StartupType
get_listening_sockets Get-NetTCPConnection -State Listen, Get-NetUDPEndpoint, Get-Process, Win32_Service (a shared svchost names no service)

running_kernel carries the full build including the update revision (10.0.20348.2340): Windows ships fixes as UBR bumps, which is what CVE matching has to compare against.

Not yet: packages, Windows Update, scheduled tasks, health metrics, Hyper-V. See netork#300 for the plan.

Preparing a host

WinRM is on by default on Windows Server; on Windows 10/11 run Enable-PSRemoting once. Then either

  • HTTPS (5986, default) — needs a certificate-backed HTTPS listener, or
  • HTTP (5985) — set the device port to 5985. Traffic is still encrypted at message level (NTLM/Kerberos), credentials never travel in the clear.

A local administrator account additionally needs LocalAccountTokenFilterPolicy = 1 under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System; without it remote UAC strips the admin token. Domain accounts are not affected.

optional_args

Key Default Meaning
port 5986 WinRM port
winrm_ssl port != 5985 force HTTPS on or off
winrm_auth negotiate pypsrp auth protocol (negotiate, ntlm, kerberos, credssp, basic)
ssl_verify True validate the WinRM certificate

Development

The rules are in STANDARDS.md.

python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest --cov

Tests and fixtures

tests/fixtures/synthetic/ holds the JSON the scripts are designed to emit. To record the real thing from a host:

python tools/harvest.py <host> <user> <label> [--port 5985] [--insecure]

Output lands in tools/harvest-out/ (gitignored); scrub it before copying anything into tests/.

License

Apache-2.0, see LICENSE.

Metadata

Release files for napalm-windows 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napalm-windows 0.2.0
File Size Uploaded Provenance Actions
napalm_windows-0.2.0.tar.gz 22.4 kB Without provenance Details for napalm_windows-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napalm-windows 0.2.0
File Interpreter ABI Platform Actions
napalm_windows-0.2.0-py3-none-any.whl Python 3 none any Details for napalm_windows-0.2.0-py3-none-any.whl

Total release size: 38.4 kB

Release files / napalm_windows-0.2.0.tar.gz

Download URL napalm_windows-0.2.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5497b96c57783100cbeded4532540a74db8d6f9511b8fbb4aab4c3cb780088de
BLAKE2b-256 checksum
How to use checksums
23c86b518783700da2373be4d9b3c95c55f69e0bc1628001f1c98aa897791e45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / napalm_windows-0.2.0-py3-none-any.whl

Download URL napalm_windows-0.2.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35bbf09711a4b52ecc3a6135fd81eb33e662e32baaddcdf32809d0af13340a27
BLAKE2b-256 checksum
How to use checksums
f3a4ec5a27b1eb59a7375b5c57e55da0cd805d79b09d86f4ce723eb5f284986b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for napalm-windows 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page