Skip to content

Commit

Permalink
systemd: unit hardening
Browse files Browse the repository at this point in the history
This increases the isolation of TheLounge service.

This patch does not set `SystemCallFilter` option as it might break old
Debian-based distributions due to a different naming convention for predefined
call sets.
  • Loading branch information
erdnaxe committed Jan 7, 2022
1 parent 98812b0 commit 9af1c1a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions systemd/system.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@ User=thelounge
Group=thelounge
Type=simple
ExecStart=/usr/bin/thelounge start

# Hardening
LockPersonality=yes
ProtectSystem=yes
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
RemoveIPC=yes
# cacheable-lookup module requires AF_NETLINK
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictNamespaces=yes
RestrictRealtime=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes

[Install]
Expand Down

0 comments on commit 9af1c1a

Please sign in to comment.