summaryrefslogtreecommitdiffstats
path: root/man/systemd.exec.xml
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-18 21:19:54 +0200
committerLennart Poettering <lennart@poettering.net>2018-06-14 17:44:20 +0200
commit705268414f6ba6aa96c56d6c39b5ebf74426e847 (patch)
tree2269d0bc9a7ffee385bfca234500ce0f6ba22d1d /man/systemd.exec.xml
parentmkosi: add mkosi snippet for ubuntu, too (diff)
downloadsystemd-705268414f6ba6aa96c56d6c39b5ebf74426e847.tar.xz
systemd-705268414f6ba6aa96c56d6c39b5ebf74426e847.zip
seccomp: add new system call filter, suitable as default whitelist for system services
Currently we employ mostly system call blacklisting for our system services. Let's add a new system call filter group @system-service that helps turning this around into a whitelist by default. The new group is very similar to nspawn's default filter list, but in some ways more restricted (as sethostname() and suchlike shouldn't be available to most system services just like that) and in others more relaxed (for example @keyring is blocked in nspawn since it's not properly virtualized yet in the kernel, but is fine for regular system services).
Diffstat (limited to 'man/systemd.exec.xml')
-rw-r--r--man/systemd.exec.xml12
1 files changed, 12 insertions, 0 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index a17db8d850..3bd790b485 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -1491,6 +1491,10 @@ RestrictNamespaces=~cgroup net</programlisting>
<entry>Synchronizing files and memory to disk: (<citerefentry project='man-pages'><refentrytitle>fsync</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>msync</refentrytitle><manvolnum>2</manvolnum></citerefentry>, and related calls)</entry>
</row>
<row>
+ <entry>@system-service</entry>
+ <entry>A reasonable set of system calls used by common system services, excluding any special purpose calls. This is the recommended starting point for whitelisting system calls for system services, as it contains what is typically needed by system services, but excludes overly specific interfaces. For example, the following APIs are excluded: <literal>@clock</literal>, <literal>@mount</literal>, <literal>@swap</literal>, <literal>@reboot</literal>.</entry>
+ </row>
+ <row>
<entry>@timer</entry>
<entry>System calls for scheduling operations by time (<citerefentry project='man-pages'><refentrytitle>alarm</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>timer_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>, …)</entry>
</row>
@@ -1504,6 +1508,14 @@ RestrictNamespaces=~cgroup net</programlisting>
<command>systemd-analyze syscall-filter</command> to list the actual list of system calls in each
filter.</para>
+ <para>Generally, whitelisting system calls (rather than blacklisting) is the safer mode of operation. It is
+ recommended to enforce system call whitelists for all long-running system services. Specifically, the
+ following lines are a relatively safe basic choice for the majority of system services:</para>
+
+ <programlisting>[Service]
+SystemCallFilter=@system-service
+SystemCallErrorNumber=EPERM</programlisting>
+
<para>It is recommended to combine the file system namespacing related options with
<varname>SystemCallFilter=~@mount</varname>, in order to prohibit the unit's processes to undo the
mappings. Specifically these are the options <varname>PrivateTmp=</varname>,