Sandbox a systemd service with measured controls
8 steps · about 2 h 42 min · Intermediate
- Measure the service's starting exposure (reference, systemd manual, 18 min)
A security score and explanation provide a reviewable baseline instead of choosing controls by guesswork.
- Keep service credentials out of ordinary files (guide, systemd documentation, 24 min)
Credential delivery reduces the need to expose sensitive configuration through broad filesystem access.
- Review service termination assumptions (reference, systemd manual, 20 min)
Sandboxing must preserve deliberate stop and signal behaviour rather than leaving child processes behind.
- Separate sandboxing from resource control (reference, systemd manual, 22 min)
CPU, memory and task boundaries limit impact but solve a different problem from privilege restrictions.
- Inspect local unit overrides (reference, systemd manual, 20 min)
Delta inspection keeps local policy distinct from the packaged unit and makes review and rollback straightforward.
- Prototype restrictions in a transient unit (reference, systemd manual, 20 min)
A transient unit can validate selected properties and inspect effective state before the packaged service changes.
- Preserve evidence from a sandboxed crash (reference, systemd manual, 20 min)
Crash metadata helps distinguish an incompatible control from an unrelated application defect.
- Re-score and document the final policy (reference, systemd manual, 18 min)
The directive index helps verify spelling and scope before recording the final score, tests and justified exceptions.