Results of trial and error on the [Service]
settings in man 5 systemd.exec
MountAPIVFS=
: implied by other settings belowProtectProc=invisible
: hides subtrees from other pids in /proc/
,
other things like /proc/cpuinfo
remain availableProcSubset=pid
: hides everything else, leaving just
/proc/<pid>
, /proc/self/
, /proc/thread-self/
DynamicUser=true
: dynamically allocated user/group, username uses service name.
Note this also affects binaries with setuid/setcap on them,
as they are forced to be a different user (so don't get the capabilities originally granted).CapabilityBoundingSet=cap_net_bind_service
limits existing capabilities (eg if you're root)AmbientCapabilities=cap_net_bind_service
: grants new capabilitiesNoNewPrivileges=true
: prevents bypasses by execing other processes.SecureBits=noroot-locked
: do not grant capabilities from file systemProtectSystem=strict
: Filesystem (except /dev/
, /proc
, /sys/
is readonly,
unless allowed by other settingsPrivateDevices=true
: Hides non virtual things in /dev/
PrivateIPC=true
PrivateUser
: hides other usersProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
, make /proc/
and /sys/
settings read onlyProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictNamespaces=true
LockPersonality=true
(system architecture, eg x86_64 + x86)MemoryDenyWriteExecute=true
RestrictRealtime=true
RemoveIPC=true
RestrictSUIDSGID=true
, implied by DynamicUserPrivateMounts=true
hides mounts from host