This introduces set of hardening options to systemd's unit to isolate service more.
Applied restrictions are (among other):
- no capabilities, and these cannot be changed (so calling binary with capabilities may cause an issue)
- cannot call SUID/GUID binaries
- restrict view on the OS to minimum
- hide some shared resources (like users or
/tmp) - disallow non-UNIX and non-INET(4/6) sockets
- protect kernel settings and logs
- force native syscalls (so for example on x86-64 there is no way to call x86 syscalls)
- limit executables to Nix store
These shouldn't be too restrictive for most users.
Thank you for your contribution!
tbh I'm not fully understanding what all those option mean, but afaict this is roughly same to what
bluesky-pdsis using except these chunks. So I guess it's fine to blindly merge? cc @anirudh.fi@hauleth.dev can we have at least
CAP_NET_BIND_SERVICEtoCapabilityBoundingSet? Users should be able to set knot port directly to80/443.