Browse Source

systemd-security: add some easy wins

We can tighten security by adding the following to
the systemd service file:

* NoNewPrivileges: should never be needed
* DevicePolicy: only basics required
* PrivateDevices: only needs mounted stuff, never devs
* ProtectSystem: no need to change boot
* RestrictAddressFamilies: INET, UNIX only

Signed-off-by: Marc <[email protected]>
Marc 3 năm trước cách đây
mục cha
commit
9b6b9cca3d
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      init/sftpgo.service

+ 5 - 0
init/sftpgo.service

@@ -17,6 +17,11 @@ KillMode=mixed
 PrivateTmp=true
 Restart=always
 RestartSec=10s
+NoNewPrivileges=yes
+PrivateDevices=yes
+DevicePolicy=closed
+ProtectSystem=true
+RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
 
 [Install]
 WantedBy=multi-user.target