report-basic: lock down the service

The basic approach is copied from systemd-journal-gatewayd.service,
with some additions to lock down unneeded network access.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-04-01 16:38:14 +02:00
parent b47139e489
commit 5d0a953960
2 changed files with 25 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ ListenStream=/run/systemd/report/io.systemd.Basic
FileDescriptorName=varlink
SocketMode=0666
Accept=yes
MaxConnectionsPerSource=16
RemoveOnStop=yes
[Install]
+24
View File
@@ -10,4 +10,28 @@
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