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 6, 2022
1 parent 98812b0 commit f00c8fe
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions systemd/system.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,27 @@ 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
ProcSubset=pid
RemoveIPC=yes
# cacheable-lookup module requires AF_NETLINK
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes

[Install]
Expand Down

0 comments on commit f00c8fe

Please sign in to comment.