summarylogtreecommitdiffstats
path: root/030-xd-torrent-service-hardening.patch
blob: bcdf9dbcfc793366d6e773297b0bc05b1296a9fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/contrib/systemd/xd.service
+++ b/contrib/systemd/xd.service
@@ -9,5 +9,31 @@ WorkingDirectory=/var/lib/xd
 ExecStart=/usr/bin/XD /var/lib/xd/xd.conf
 Restart=on-failure
 
+# hardening options
+PrivateTmp=true
+ProtectSystem=strict
+ProtectHome=true
+PrivateDevices=true
+ProtectKernelTunables=true
+ProtectControlGroups=true
+NoNewPrivileges=true
+MemoryDenyWriteExecute=true
+LockPersonality=true
+SystemCallFilter=@system-service
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
+ProtectHostname=true
+ProtectClock=true
+ProtectKernelLogs=true
+ProtectKernelModules=true
+ProtectProc=invisible
+ProcSubset=pid
+PrivateMounts=true
+PrivateUsers=true
+ReadWritePaths=/var/lib/xd
+RemoveIPC=true
+RestrictRealtime=true
+RestrictSUIDSGID=true
+SystemCallArchitectures=native
+
 [Install]
 WantedBy=default.target