Security Hardening
Systemg's privileged features are intentionally opt-in, enabling operators to layer additional kernel protections only when required. This page summarises the current implementation status and outlines the roadmap for upcoming security features.
Capabilities
Implemented via the caps crate on Linux:
- Capabilities default to none; specifying a list retains only those entries across the privilege drop.
- Ambient capabilities are set after the UID switch so services can bind privileged ports without running as root.
- Non-Linux targets log warnings when capabilities are requested.
Resource Limits & Cgroups
limitsmaps tosetrlimit,setpriority, andsched_setaffinity.limits.cgroupwrites to cgroup v2 controllers (memory/cpu); the optionalrootfield helps in chroot/testing scenarios.- Writes are best-effort: the supervisor logs warnings when the kernel denies access instead of failing the start.
Namespace Isolation
isolationtoggles (network,pid,mount,user) callunshareon Linux. Unsupported kernels or missing privileges produce warnings.private_devicesandprivate_tmpare placeholders; they warn until full device / tmpfs remounting is implemented.
Upcoming Features
| Feature | Status | Notes |
|---|---|---|
seccomp | Planned | Will integrate filter profiles prior to exec. |
apparmor_profile | Planned | Requires operating system policy support. |
selinux_context | Planned | Will rely on setfscreatecon where available. |
| Device isolation | Planned | private_devices toggle currently logs warnings. |
| Temporary filesystem isolation | Planned | private_tmp toggle currently logs warnings. |
Future updates will extend the CLI and configuration to surface kernel-space enforcement more explicitly. Track progress via the GitHub issue queue.
Troubleshooting
- If namespace unshare fails with
EPERM, ensure the service retains the required capabilities (e.g.CAP_SYS_ADMINforCLONE_NEWNS). - Cgroup writes may fail inside containers; adjust
limits.cgroup.rootto point to a writable hierarchy (e.g./sys/fs/cgroup/user.slice/...). - Socket activation requires clearing
LISTEN_PID/LISTEN_FDSonce the supervisor has captured them; systemg does this automatically.