]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
report-basic: lock down the service
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 5 Mar 2026 11:17:47 +0000 (12:17 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 1 Apr 2026 14:38:14 +0000 (16:38 +0200)
The basic approach is copied from systemd-journal-gatewayd.service,
with some additions to lock down unneeded network access.

units/systemd-report-basic.socket
units/systemd-report-basic@.service.in

index bce93091968958fa81067ec80ca7255398389e0e..bfa4ea72568feade2d0f97c7afd9f5d8970211d0 100644 (file)
@@ -16,6 +16,7 @@ ListenStream=/run/systemd/report/io.systemd.Basic
 FileDescriptorName=varlink
 SocketMode=0666
 Accept=yes
+MaxConnectionsPerSource=16
 RemoveOnStop=yes
 
 [Install]
index ad4e3fce708578353064e146ba7ead806dc7efde..a8a3b76e865c7cc1af4ed6e3b44f2e0ce89609e9 100644 (file)
 Description=Report System Basic Facts
 
 [Service]
+CapabilityBoundingSet=
+DeviceAllow=
+DynamicUser=yes
+LockPersonality=yes
+MemoryDenyWriteExecute=yes
+PrivateDevices=yes
+PrivateIPC=yes
+PrivateNetwork=yes
+PrivateTmp=disconnected
+ProtectControlGroups=yes
+ProtectHome=yes
+ProtectHostname=yes
+ProtectKernelLogs=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+ProtectSystem=strict
+RestrictAddressFamilies=AF_UNIX
+RestrictNamespaces=yes
+RestrictRealtime=yes
+RestrictSUIDSGID=yes
+SystemCallArchitectures=native
+SystemCallErrorNumber=EPERM
+SystemCallFilter=@system-service
+
 ExecStart={{LIBEXECDIR}}/systemd-report-basic