From 67a9340a14f5d835d972a72a28702db31086dbbc Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 27 Jul 2025 15:13:31 +0100 Subject: Harden systemd service file --- dist/scrapbook.service | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'dist') diff --git a/dist/scrapbook.service b/dist/scrapbook.service index c12ed45..a4871a9 100644 --- a/dist/scrapbook.service +++ b/dist/scrapbook.service @@ -7,5 +7,29 @@ Group=scrapbook Restart=always ExecStart=/usr/local/bin/scrapbook +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE +NoNewPrivileges=true +SystemCallFilter=@system-service +SystemCallErrorNumber=EPERM + +ProtectSystem=strict +ProtectHome=true +PrivateTmp=true +PrivateDevices=true +TemporaryFileSystem=/var:ro /etc:ro +BindReadOnlyPaths=/etc/scrapbook +BindPaths=/var/lib/scrapbook +NoExecPaths=/ +ExecPaths=/usr/local/bin/scrapbook + +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +ProtectClock=true +RestrictRealtime=true +RestrictSUIDSGID=true + [Install] WantedBy=multi-user.target -- cgit v1.2.3-70-g09d2