Merge remote-tracking branch 'origin/main' into feature/scheduled-jobs
# Conflicts: # pyproject.toml
This commit is contained in:
commit
5ced67d4e4
5 files changed
+38
-22
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"""OpenMediaVault writes sshd_config itself, from its own database.
|
||||
|
||||
The Linux driver offers to harden the SSH server by writing a drop-in under
|
||||
/etc/ssh/sshd_config.d (NetOrk/netork#1027). OMV's template ends with
|
||||
``Include /etc/ssh/sshd_config.d/*.conf`` and salt manages only sshd_config,
|
||||
so the drop-in survives the next apply of the SSH settings
|
||||
(``omv-salt deploy run ssh``) and the hardening is offered. Only sshd_config
|
||||
itself is off limits: that apply would write over it, so an OMV whose
|
||||
sshd_config does not include the directory is left alone
|
||||
(``SSHD_CONFIG_GENERATED``).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
|
||||
|
||||
|
||||
def test_offers_ssh_hardening():
|
||||
assert callable(getattr(OpenMediaVaultDriver, "harden_ssh_server", None))
|
||||
|
||||
|
||||
def test_writes_only_the_dropin():
|
||||
assert OpenMediaVaultDriver.SSHD_CONFIG_GENERATED is True
|
||||
@@ -1,16 +0,0 @@
|
||||
"""OpenMediaVault writes sshd_config itself, from its own database.
|
||||
|
||||
The Linux driver offers to harden the SSH server by writing a drop-in under
|
||||
/etc/ssh/sshd_config.d (NetOrk/netork#1027). On OMV the next apply of the SSH
|
||||
settings (``omv-salt deploy run ssh``) would regenerate the configuration and
|
||||
take the change back without a word, so this driver opts out: netOrk's
|
||||
capability probe asks ``callable(harden_ssh_server)``.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
|
||||
|
||||
|
||||
def test_does_not_offer_ssh_hardening():
|
||||
assert not callable(getattr(OpenMediaVaultDriver, "harden_ssh_server", None))
|
||||
Reference in new issue
Block a user