fix(systemd_hardening): look up the listed units instead of listing every unit file #298

Merged
Dragonish merged 2 commits from fix/283-systemd-hardening-probe into main 2026-11-22 20:09:26 +00:00
2 Commits
Author SHA1 Message Date
Defame1297 4dc221c17f Merge branch 'main' into fix/283-systemd-hardening-probe
Build / build (pull_request) Successful in 25s
Molecule / molecule (pull_request) Successful in 55s
Lint / lint (pull_request) Successful in 1m22s
2026-11-22 20:03:08 +00:00
Dragonish 6c2d124b3f fix(systemd_hardening): look up the listed units instead of listing every unit file
Build / build (pull_request) Successful in 20s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 38s
The role listed every service unit file to answer one question: is each
unit in its disable and mask lists installed? The listing keeps PID 1 busy
for as long as the host has unit files. Ask about the listed units only,
with one `systemctl show --property=LoadState`; a unit with no unit file
reports `not-found` and is skipped as before.

An instance name such as [email protected] is now matched when its template
exists. A template name such as [email protected] makes the lookup fail, where
the listing matched it.

Closes #283

Assisted-by: Claude Code
2026-11-22 19:41:23 +00:00