summaryrefslogtreecommitdiffstats
path: root/roles/common/files
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2018-12-09 18:15:10 +0100
committerGuilhem Moulin <guilhem@fripost.org>2018-12-09 20:25:40 +0100
commit2147ff3bd9091b88960e2243b2d7d76d03cadc89 (patch)
treefa970590ab58a1d42913deccbca3adef05eaae83 /roles/common/files
parent2845af5f76ad3be9c0a1f69ab478ff5a08346a4c (diff)
systemd.service: Tighten hardening options.
Diffstat (limited to 'roles/common/files')
-rw-r--r--roles/common/files/etc/systemd/system/bacula-fd.service5
-rw-r--r--roles/common/files/etc/systemd/system/stunnel4@.service5
2 files changed, 10 insertions, 0 deletions
diff --git a/roles/common/files/etc/systemd/system/bacula-fd.service b/roles/common/files/etc/systemd/system/bacula-fd.service
index 192ea1b..792d964 100644
--- a/roles/common/files/etc/systemd/system/bacula-fd.service
+++ b/roles/common/files/etc/systemd/system/bacula-fd.service
@@ -1,20 +1,25 @@
[Unit]
Description=Bacula File Daemon service
After=network.target
[Service]
Type=simple
StandardOutput=syslog
ExecStart=/usr/sbin/bacula-fd -f -c /etc/bacula/bacula-fd.conf
# Hardening
NoNewPrivileges=yes
PrivateDevices=yes
ProtectHome=read-only
ProtectSystem=strict
PrivateTmp=yes
ReadWriteDirectories=-/var/lib
ReadWriteDirectories=-/var/run/bacula
+PrivateDevices=yes
+ProtectControlGroups=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
[Install]
WantedBy=multi-user.target
diff --git a/roles/common/files/etc/systemd/system/stunnel4@.service b/roles/common/files/etc/systemd/system/stunnel4@.service
index d634e50..1a30599 100644
--- a/roles/common/files/etc/systemd/system/stunnel4@.service
+++ b/roles/common/files/etc/systemd/system/stunnel4@.service
@@ -1,22 +1,27 @@
[Unit]
Description=SSL tunnel for network daemons (instance %i)
After=network.target nss-lookup.target
PartOf=stunnel4.service
ReloadPropagatedFrom=stunnel4.service
[Service]
ExecStart=/usr/bin/stunnel4 /etc/stunnel/%i.conf
ExecReload=/bin/kill -HUP ${MAINPID}
KillSignal=SIGINT
TimeoutStartSec=120
TimeoutStopSec=60
Restart=on-failure
# Hardening
NoNewPrivileges=yes
PrivateDevices=yes
ProtectHome=yes
ProtectSystem=strict
+PrivateDevices=yes
+ProtectControlGroups=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+RestrictAddressFamilies=AF_INET AF_INET6
[Install]
WantedBy=multi-user.target