]> git.ipfire.org Git - thirdparty/systemd.git/commit - man/systemd.exec.xml
core: add new RestrictNamespaces= unit file setting 4536/head
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Nov 2016 02:25:19 +0000 (20:25 -0600)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Nov 2016 13:40:13 +0000 (07:40 -0600)
commitadd005357d535681c7075ced8eec2b6e61b43728
treeb780280f06df0b09c738173602cb90c599597996
parent9156493171cf2d78e1ac1a3746c385b0e281acf1
core: add new RestrictNamespaces= unit file setting

This new setting permits restricting whether namespaces may be created and
managed by processes started by a unit. It installs a seccomp filter blocking
certain invocations of unshare(), clone() and setns().

RestrictNamespaces=no is the default, and does not restrict namespaces in any
way. RestrictNamespaces=yes takes away the ability to create or manage any kind
of namspace. "RestrictNamespaces=mnt ipc" restricts the creation of namespaces
so that only mount and IPC namespaces may be created/managed, but no other
kind of namespaces.

This setting should be improve security quite a bit as in particular user
namespacing was a major source of CVEs in the kernel in the past, and is
accessible to unprivileged processes. With this setting the entire attack
surface may be removed for system services that do not make use of namespaces.
15 files changed:
Makefile.am
TODO
man/systemd.exec.xml
src/core/dbus-execute.c
src/core/execute.c
src/core/execute.h
src/core/load-fragment-gperf.gperf.m4
src/core/load-fragment.c
src/core/load-fragment.h
src/shared/bus-unit-util.c
src/shared/nsflags.c [new file with mode: 0644]
src/shared/nsflags.h [new file with mode: 0644]
src/shared/seccomp-util.c
src/shared/seccomp-util.h
src/test/test-seccomp.c