SystemD Service Hardening

Perceived Quality of the Article

  • Many commenters find this hardening guide substantially more concrete and useful than a similar post from the previous day, praising the real-world examples and actionable tips.
  • At least one reader considers it “low quality / low density” and questions why it was posted, but doesn’t elaborate much further when challenged.

systemd vs Other Init Systems

  • Several comments emphasize how much easier systemd makes uniform use of kernel features (namespaces, cgroups, restarts, supervision) compared to ad‑hoc SysV init scripts.
  • Others argue alternatives like OpenRC or runit can do the same job with simpler primitives, but acknowledge that complexity must then move into shell scripts or separate supervision tools.
  • There is debate over systemd’s complexity and “scope creep”:
    • Critics say it reimplements too much (cron, syslog, device management, containers, etc.) and feels like a Red Hat–driven power grab.
    • Defenders counter that “systemd the project” is just many optional binaries communicating over IPC, while “systemd-init” itself is stable and well-documented.

Why systemd “Won”

  • Some attribute adoption to Red Hat’s backing and GNOME dependencies.
  • Others stress that systemd solved real problems for distributors and professional admins: consistent restarts, status, dependency handling, and easier packaging across distros.
  • Vocal online opposition is portrayed as a minority of contrarians not responsible for maintaining distributions or shipping binaries.

Service Hardening Mechanisms

  • Commenters like systemd-analyze security as a way to score and compare hardening, but warn that people may optimize only to satisfy the scanner.
  • A tool (shh) that auto-generates security directives from strace is highlighted.
  • Advanced tricks like using TemporaryFileSystem=/ plus BindReadOnly= are discussed for strict filesystem sandboxes.
  • Several note that most distro unit files remain poorly hardened; examples from Debian show many core services rated “UNSAFE”.
  • Reasons given for distros not enabling more aggressive settings: risk of subtle breakage, lack of integration tests, maintenance overhead, and uncertainty about whether upstream or distro should own the policies.

Alternative Hardening Approaches

  • Some argue the “best hardening” is using OpenRC/runit, Qubes OS, or strong MAC/sandboxing (SELinux, AppArmor, Firejail, pledge).
  • There is skepticism that shifting hardening to end users (SELinux, AppArmor, systemd unit flags) will ever “take off” widely.

Other systemd Features & Miscellany

  • Credential management (CREDENTIALS_DIRECTORY) is praised as a safer alternative to env vars or files, with minor debate about whether a thin helper library is worthwhile.
  • Several people mention it would be useful to have a shared repository of hardened unit templates for common services.
  • There is a small subthread on the correct lowercase spelling “systemd” and how mis-capitalization often correlates with criticism.