feat(hardening): get_hardening through HardeningMixin, 0.20.0 (NetOrk/netork#2706) #87

Merged
christianmanivong merged 3 commits from feature/hardening-reading into main 2026-11-28 01:55:30 +00:00
Owner

get_hardening() through napalm-device-types' HardeningMixin (4.48.0, NAPALM/napalm-device-types branch feature/hardening-reading), for NetOrk/netork#2706.

_run_hardening_command(command, *, privileged) runs the shared, read-only command on an exec channel, because aa-status --json prints one line longer than the PTY holds reliably. It runs as root first for AppArmor's profiles, and as the login user where root is refused. OpenMediaVault and QNAP get it through LinuxDriver.

Requires napalm-device-types>=4.48.0. CI stays red until 4.48.0 is released and on the runner's index (about 25 minutes after the tag). That is expected.

Tested: TestGetHardening in tests/test_linux.py, covering the exec channel as root and the fallback when root is refused. Full suite green locally against the device-types branch (469 passed), ruff and mypy clean.

`get_hardening()` through napalm-device-types' `HardeningMixin` (4.48.0, NAPALM/napalm-device-types branch `feature/hardening-reading`), for NetOrk/netork#2706. `_run_hardening_command(command, *, privileged)` runs the shared, read-only command on an exec channel, because `aa-status --json` prints one line longer than the PTY holds reliably. It runs as root first for AppArmor's profiles, and as the login user where root is refused. OpenMediaVault and QNAP get it through `LinuxDriver`. Requires `napalm-device-types>=4.48.0`. **CI stays red until 4.48.0 is released and on the runner's index (about 25 minutes after the tag).** That is expected. Tested: `TestGetHardening` in `tests/test_linux.py`, covering the exec channel as root and the fallback when root is refused. Full suite green locally against the device-types branch (469 passed), ruff and mypy clean.
christianmanivong added 2 commits 2026-11-26 22:13:57 +00:00
The transport runs the shared, read-only command on an exec channel, as root
first for AppArmor's profiles and as the login user where root is refused.
chore(release): 0.20.0
driver / standard (pull_request) Failing after 15s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 40s
driver / types (pull_request) Failing after 49s
driver / test (3.13) (pull_request) Failing after 39s
driver / lowest (pull_request) Failing after 18s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Failing after 57s
CI / driver (pull_request) Failing after 2m8s
driver / publish (pull_request) Skipped
2aba6babcf
christianmanivong added 1 commit 2026-11-27 00:49:07 +00:00
refactor(hardening): the transport in a module of its own, not in linux.py (NetOrk/netork#2706)
driver / lint (pull_request) Successful in 12s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 53s
driver / test (3.12) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 27s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Successful in 2m10s
driver / publish (pull_request) Skipped
b67c1b3c53
linux.py is at napalm-standard's recorded size; LinuxHardeningMixin rides
along with the other readings' transports instead.
christianmanivong merged commit 963f6d2736 into main 2026-11-28 01:55:30 +00:00
christianmanivong deleted branch feature/hardening-reading 2026-11-28 01:55:30 +00:00
Sign in to join this conversation.