]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: lock down systemd-logind.service with various fs namespacing options 10744/head
authorLennart Poettering <lennart@poettering.net>
Mon, 12 Nov 2018 17:08:48 +0000 (18:08 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 12 Nov 2018 18:14:33 +0000 (19:14 +0100)
now that logind doesn't mount $XDG_RUNTIME_DIR anymore we can lock down
the service using fs namespacing (as we don't need the mount to
propagate to the host namespace anymore).

units/systemd-logind.service.in

index ff1fd96765a732028b1f6799fc907c60b40498d4..6886fa9bfefb48779b8197c7d548dc8f36ee2dc8 100644 (file)
@@ -28,11 +28,19 @@ IPAddressDeny=any
 LockPersonality=yes
 MemoryDenyWriteExecute=yes
 NoNewPrivileges=yes
+PrivateTmp=yes
+ProtectControlGroups=yes
+ProtectHome=yes
+ProtectKernelModules=yes
+ProtectSystem=strict
+ReadWritePaths=/etc
 Restart=always
 RestartSec=0
 RestrictAddressFamilies=AF_UNIX AF_NETLINK
 RestrictNamespaces=yes
 RestrictRealtime=yes
+RuntimeDirectory=systemd/sessions systemd/seats systemd/users
+RuntimeDirectoryPreserve=yes
 SystemCallArchitectures=native
 SystemCallErrorNumber=EPERM
 SystemCallFilter=@system-service