Kernel Mode
Kernel-Enforced Sandboxing
sysg configures kernel enforcement mechanisms per service: rlimits,
capabilities, namespaces, cgroups, seccomp, no_new_privs, and Landlock.
All of them are Linux, root, and enforced by the kernel — sysg only
configures them.
Limits, capabilities, and namespaces
services:
worker:
command: "./worker"
user: "worker"
limits:
nofile: 4096
cgroup:
memory_max: "512M"
capabilities: ["CAP_NET_BIND_SERVICE"]
isolation:
network: true
Syscall and filesystem confinement (schema v3)
Under version: "3":
isolation.landlock: { ro_paths, rw_paths }— a Landlock filesystem sandbox requiring ABI 3 or newer (normally Linux 6.2+, including supported backports). Truncation is granted only underrw_paths; listing a path inro_pathsdoes not grant it. The remaining handled filesystem rights retain their original ABI 1 policy. Landlock does not revoke access through descriptors opened before confinement.isolation.seccomp: "baseline-v1"— a frozen, deny-by-default syscall allowlist; unlisted syscalls returnEPERM.
sysg sets no_new_privs only when a service has an effective Landlock or
seccomp policy. It can't be undone and every child inherits it, so setuid
helpers like sudo can't gain privileges under it. For any other service sysg
leaves the inherited state alone. If the supervisor starts without
no_new_privs, those services can use sudo -u postgres ... and similar,
subject to the helper's own policy.
version: "3"
services:
worker:
command: "./worker"
isolation:
seccomp: "baseline-v1"
landlock:
ro_paths: ["/usr", "/lib", "/etc/worker"]
rw_paths: ["/var/lib/worker"]
An unsupported kernel or a malformed policy refuses the service
(SG0722/SG0724)
rather than running it unprotected. baseline-v1 is frozen; a different or
stricter policy will ship as baseline-v2, never as a silent edit.
Keys that do not enforce
isolation.pid: true refuses the service under both schema versions. PID
namespace lifecycle support is not implemented; sysg does not launch the
service in the host PID namespace while claiming it is isolated.
isolation.apparmor_profile, isolation.selinux_context,
isolation.private_devices, and isolation.private_tmp are accepted by the
schema but cannot be enforced. Schema version 3 refuses services that request
them; version 2 runs the service with a warning.
Warning
Each of these keys emits SG0721 at service start. A version 2 warning is not protection. Remove the keys only if running without the requested isolation is acceptable.
Diagnostics
- SG0721 — a security key was accepted but cannot be enforced; PID isolation is refused under both schema versions, and other unsupported keys are refused under version 3
- SG0722 — seccomp filter could not be built, compiled, or applied; service refused
- SG0723 —
no_new_privscould not be set; service refused - SG0724 — Landlock requested but the kernel ABI is unavailable or insufficient; service refused
- SG0725 — unknown seccomp profile; the
only built-in is
baseline-v1 - SG0726 — seccomp is unsupported on this CPU architecture