fix(system_baseline): persist sysctls in an own sysctl.d drop-in
Build / build (pull_request) Successful in 1m5s
Lint / lint (pull_request) Successful in 4m54s
Molecule / select (pull_request) Successful in 3s
Molecule / scenarios (pull_request) Successful in 18m54s
Molecule / Result (pull_request) Successful in 0s

systemd-sysctl on Debian 13 does not read /etc/sysctl.conf, so the
hardened values were lost on reboot. The role now applies the live values
on their own, writes them to a drop-in under /etc/sysctl.d and removes its
keys from /etc/sysctl.conf.

Refs #510

Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
Defame1297 committed 2026-12-03 17:23:51 +00:00
1 parent cf99893855
commit d88e5d237a
14 files changed
+282 -17

No files matched your search

@@ -60,6 +60,15 @@ argument_specs:
is bytes); anything else (C(infinity), a lower-case unit, a line break) is refused before any change. Empty leaves the host
alone: no drop-in is written and journald is not restarted.
Clearing the value later does not remove a file already written.
system_baseline_sysctl_file:
type: str
default: /etc/sysctl.d/99-zz-system-baseline.conf
description:
- >-
Drop-in that persists C(system_baseline_sysctl_hardening) across reboots. The role owns the whole file. It must be a C(.conf)
file directly under C(/etc/sysctl.d), other than C(99-sysctl.conf); anything else is refused before any change.
- The last file that sets a key wins at boot, in the order of the file names; a name that starts with a letter sorts after the default.
- Changing the value later does not remove the old file.
system_baseline_tmux_autostart:
type: bool
default: false