Sandbox a systemd service with measured controls

8 steps · about 2 h 42 min · Intermediate

  1. 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.

  2. 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.

  3. Review service termination assumptions (reference, systemd manual, 20 min)

    Sandboxing must preserve deliberate stop and signal behaviour rather than leaving child processes behind.

  4. 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.

  5. 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.

  6. 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.

  7. Preserve evidence from a sandboxed crash (reference, systemd manual, 20 min)

    Crash metadata helps distinguish an incompatible control from an unrelated application defect.

  8. 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.