Skip to content

Commit

Permalink
man/systemd.exec: document that API fs are required to setup namespacing
Browse files Browse the repository at this point in the history
Closes #27997

(cherry picked from commit 723c3cd)
  • Loading branch information
YHNdnzj authored and bluca committed Nov 9, 2023
1 parent 188f7c0 commit c371368
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions man/systemd.exec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1591,12 +1591,15 @@ StateDirectory=aaa/bbb ccc</programlisting>
i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated
below a path marked with <varname>ReadOnlyPaths=</varname>! Restricting access with these options hence does
not extend to submounts of a directory that are created later on. This means the lock-down offered by that
setting is not complete, and does not offer full protection. </para>
setting is not complete, and does not offer full protection.</para>

<para>Note that the effect of these settings may be undone by privileged processes. In order to set up an
effective sandboxed environment for a unit it is thus recommended to combine these settings with either
<varname>CapabilityBoundingSet=~CAP_SYS_ADMIN</varname> or
<varname>SystemCallFilter=~@mount</varname>.</para>
<varname>CapabilityBoundingSet=~CAP_SYS_ADMIN</varname> or <varname>SystemCallFilter=~@mount</varname>.</para>

<para>Please be extra careful when applying these options to API file systems (a list of them could be
found in <varname>MountAPIVPS=</varname>), since they may be required for basic system functionalities.
Moreover, <filename>/run/</filename> needs to be writable for setting up mount namespace and propagation.</para>

<para>Simple allow-list example using these directives:
<programlisting>[Service]
Expand Down

0 comments on commit c371368

Please sign in to comment.