feat: read the PVE firewall, the node's loaded ruleset, and the hardening reading (NetOrk/netork#2654, #2776) #80

Merged
christianmanivong merged 3 commits from feature/pve-firewall-2654 into main 2026-11-28 08:30:03 +00:00
Owner

Read-only reading of the Proxmox VE firewall for NetOrk/netork#2654 (options A and B, decided 2026-11-28). Nothing is written: pve-firewall rules stay the operator's.

  • get_pve_firewall() (new firewall_mixin.py, ProxmoxFirewallMixin): the datacenter's options, rules, security groups, ipsets and aliases (/cluster/firewall/...), the node's options and rules (/nodes/{n}/firewall/...), and every guest on the node (/nodes/{n}/{qemu|lxc}/{id}/firewall/options|rules, plus each NIC's firewall=1 from the guest config). Each rule keeps PVE's own fields and its origin (cluster, group, node, guest). A part PVE refuses is None, never empty.
  • get_host_firewall() via napalm-device-types' existing HostFirewallMixin (no change to napalm-device-types): the node's loaded ruleset (nft list ruleset for PVE 9's proxmox-firewall, iptables-save for pve-firewall), as root over the exec path (_run_host_firewall_command).
  • get_hardening() on both drivers (NetOrk/netork#2776): napalm-device-types' HardeningMixin with _run_hardening_command over the exec path (root's login, so AppArmor's profiles per mode are read). The dependency is now napalm_device_types>=4.48.0. Tests: tests/test_hardening.py; the full suite passes (769).
  • 0.18.0: the tags end at v0.16.0, and the open PR #78 already claims 0.17.0, so this takes the next number after it.

Tests (firewall): tests/test_firewall.py (mocked API: every level, a refused level is None, guest NICs, the host-firewall transport); the full suite passes (764).

Read-only reading of the Proxmox VE firewall for NetOrk/netork#2654 (options A and B, decided 2026-11-28). Nothing is written: pve-firewall rules stay the operator's. - `get_pve_firewall()` (new `firewall_mixin.py`, `ProxmoxFirewallMixin`): the datacenter's `options`, `rules`, security `groups`, `ipsets` and `aliases` (`/cluster/firewall/...`), the node's `options` and `rules` (`/nodes/{n}/firewall/...`), and every guest on the node (`/nodes/{n}/{qemu|lxc}/{id}/firewall/options|rules`, plus each NIC's `firewall=1` from the guest config). Each rule keeps PVE's own fields and its `origin` (`cluster`, `group`, `node`, `guest`). A part PVE refuses is `None`, never empty. - `get_host_firewall()` via napalm-device-types' existing `HostFirewallMixin` (no change to napalm-device-types): the node's loaded ruleset (`nft list ruleset` for PVE 9's proxmox-firewall, `iptables-save` for pve-firewall), as root over the exec path (`_run_host_firewall_command`). - `get_hardening()` on **both** drivers (NetOrk/netork#2776): napalm-device-types' `HardeningMixin` with `_run_hardening_command` over the exec path (root's login, so AppArmor's profiles per mode are read). The dependency is now `napalm_device_types>=4.48.0`. Tests: `tests/test_hardening.py`; the full suite passes (769). - 0.18.0: the tags end at v0.16.0, and the open PR #78 already claims 0.17.0, so this takes the next number after it. Tests (firewall): `tests/test_firewall.py` (mocked API: every level, a refused level is None, guest NICs, the host-firewall transport); the full suite passes (764).
christianmanivong added 2 commits 2026-11-28 04:12:52 +00:00
chore(release): 0.18.0
driver / lint (pull_request) Successful in 16s
driver / standard (pull_request) Successful in 18s
driver / types (pull_request) Successful in 57s
driver / test (3.13) (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 2m21s
driver / publish (pull_request) Skipped
59839b4efa
christianmanivong added 1 commit 2026-11-28 07:01:40 +00:00
feat(hardening): get_hardening on both drivers over the exec path; needs device-types 4.48.0 (NetOrk/netork#2776)
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 17s
driver / types (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 1m7s
driver / test (3.12) (pull_request) Successful in 1m11s
driver / lowest (pull_request) Successful in 37s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 2m29s
driver / publish (pull_request) Skipped
b6bb13009f
christianmanivong changed title from feat(firewall): read the PVE firewall at every level, and the node's loaded ruleset (NetOrk/netork#2654) to feat: read the PVE firewall, the node's loaded ruleset, and the hardening reading (NetOrk/netork#2654, #2776) 2026-11-28 07:03:34 +00:00
christianmanivong merged commit 0598a183df into main 2026-11-28 08:30:03 +00:00
Sign in to join this conversation.