PortGate

Blueprints · Systemd & Agents

Production 15 min · systemd

systemd sandbox defaults

Stages a drop-in with NoNewPrivileges, PrivateTmp, and ProtectSystem. Merge it into a unit you have tested.

Live config

Baked-in protections

Step 1 · ini

Drop-in

/root/portgate-blueprints/sandbox.conf

This breaks units that need to write outside the paths you list. Test it on one service.

[Service]
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/app

Step 2 · bash

Read-only check

/root/portgate-blueprints/sandbox-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
systemctl --version | head -n 1