Cut systemd sandbox exposure on every unit
Cut systemd sandbox exposure across every unit this platform
installs — a dead‑man's‑switch service from 9.6 UNSAFE to 1.5, an
internet‑facing git forge from 8.3 EXPOSED to 1.5 — and added a
converge‑time parser check after finding a misspelled directive
silently ignored in three unit templates.
September 2026

Situation. Thirteen unit files were installed by this repository and
run on the production host with the privileges the supervisor gives
by default, which is most of them. A hardening score put the
dead‑man's‑switch service at 9.6 and called it unsafe; the
internet‑facing git forge scored 8.3 and exposed. Both numbers were
accurate and neither had prompted anything, because a score with no
threshold attached is a number people learn to skip.

Task. Every unit needed a sandbox proportional to what it actually
does, and the sandboxes needed a check, because the failure mode of
a wrong sandbox is that the unit starts and then breaks somewhere
the parser cannot see.

Action. Privilege restrictions went into every unit template — a
privilege ceiling fixed at the unit's own, a system‑call filter,
restricted address families, and memory that is writable or
executable but never both. The measured results: the dead‑man's
switch went from 9.6 to 1.5, the forge from 8.3 to 1.5, and both
backup units from 9.6 to 2.3 and 2.5. Writing them turned up
something better than the scores. One directive had been misspelled
in three unit templates for as long as those roles had existed — a
plausible‑looking name that does not exist, which the supervisor
answers by logging that it does not recognise the key and starting
the unit anyway. Grepping for a directive proves it was written;
only the parser proves it took effect. So a verification role now
runs every unit through the supervisor's own verifier during the
converge, and is included by every role that installs a unit. What
that still cannot see is stated plainly in the same documents: every
directive capable of breaking these units breaks them at runtime,
not at parse time, and a score cannot tell whether a script still
reaches its last line.

Result. Every unit runs with the privileges it needs and not the
ones it does not, the numbers are measured rather than asserted, and
the class of defect where a typo becomes a silently absent control
now fails a run. The limits of the measurement are recorded next to
it, which is the part that keeps the next reader from over‑trusting
a green band.

Categories:
1Infrastructure	/categories/infrastructure/	platform.engineer.company	70
1Containers (Docker/Kubernetes)	/categories/containers/	platform.engineer.company	70
1Automation & CI/CD	/categories/automation/	platform.engineer.company	70
1Linux & Servers	/categories/linux/	platform.engineer.company	70
1Security	/categories/security/	platform.engineer.company	70
1Testing & QA	/categories/testing/	platform.engineer.company	70

Services:
1Infrastructure as Code	/services/infrastructure-as-code/	platform.engineer.company	70
1Containerization & Orchestration	/services/containerization/	platform.engineer.company	70
1System Administration	/services/system-administration/	platform.engineer.company	70
1Security & Access Management	/services/security-access/	platform.engineer.company	70

hThis page on the web	URL:https://platform.engineer.company/portfolio/cut-systemd-sandbox-exposure-on-every-unit/	platform.engineer.company	70
