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

This commit is contained in:
Christian Manivong committed 2026-11-28 08:01:27 +01:00
1 parent 59839b4efa
commit b6bb13009f
7 files changed
+92 -1

No files matched your search

+2
View File
@@ -19,6 +19,7 @@ from napalm_device_types import (
BackupServerDriver,
EnsurePackageMixin,
FingerprintRule,
HardeningMixin,
HostStatusMixin,
KernelFactsMixin,
LicenseMixin,
@@ -65,6 +66,7 @@ class ProxmoxBackupDriver(
BackupServerDriver,
StorageDriver,
KernelFactsMixin,
HardeningMixin,
ServicePackagesMixin,
ListeningSocketsMixin,
LogSourcesMixin,
+2
View File
@@ -29,6 +29,7 @@ from napalm_device_types import (
AptProxyMixin,
EnsurePackageMixin,
FingerprintRule,
HardeningMixin,
HostFirewallMixin,
HostStatusMixin,
HypervisorDriver,
@@ -103,6 +104,7 @@ class ProxmoxDriver(
ProxmoxFirewallMixin,
KernelFactsMixin,
HostFirewallMixin,
HardeningMixin,
ServicePackagesMixin,
ListeningSocketsMixin,
LogSourcesMixin,
+6
View File
@@ -72,6 +72,12 @@ class ProxmoxHostMixin:
"""The transport for ``KernelFactsMixin.get_kernel_facts``: the exec path."""
return self._exec_ssh_command(command)
def _run_hardening_command(self, command: str, *, privileged: bool) -> str:
"""The transport for ``HardeningMixin.get_hardening`` (NetOrk/netork#2776): the exec
path, which is root's login, so AppArmor's profiles per mode are read too. Another
login reads the rest without them, as napalm-device-types' fallback does. No stdin."""
return str(self._exec_ssh_command(command))
def _run_host_firewall_command(self, command: str, *, privileged: bool) -> str:
"""The transport for ``HostFirewallMixin.get_host_firewall``: the exec path, which
runs as root either way. What the node has loaded -- proxmox-firewall's nftables