diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2016-05-12 11:34:36 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2016-05-12 11:34:36 +0200 |
commit | e51921b1242b40eefd16f29bcc408c6ac0df1619 (patch) | |
tree | 12f93d8d743d39fc9a4d1d6836d04eccf163b24f | |
parent | 90d498034b891123350785a134402172de477f4f (diff) |
Add hardening options to our systemd unit files.
6 files changed, 56 insertions, 1 deletions
diff --git a/roles/bacula-dir/files/lib/systemd/system/bacula-director.service b/roles/bacula-dir/files/lib/systemd/system/bacula-director.service index 7b34c8b..8f952c6 100644 --- a/roles/bacula-dir/files/lib/systemd/system/bacula-director.service +++ b/roles/bacula-dir/files/lib/systemd/system/bacula-director.service @@ -7,8 +7,18 @@ Type=forking PIDFile=/var/run/bacula/bacula-dir.9101.pid StandardOutput=syslog User=bacula -Group=tape +Group=bacula ExecStart=/usr/sbin/bacula-dir -c /etc/bacula/bacula-dir.conf +# Hardening +NoNewPrivileges=yes +PrivateDevices=yes +ProtectHome=yes +ProtectSystem=full +ReadOnlyDirectories=/ +ReadWriteDirectories=-/var/lib/bacula +ReadWriteDirectories=-/var/log/bacula +ReadWriteDirectories=-/var/run/bacula + [Install] WantedBy=multi-user.target diff --git a/roles/bacula-sd/files/lib/systemd/system/bacula-sd.service b/roles/bacula-sd/files/lib/systemd/system/bacula-sd.service index 4c3f81d..ca147a7 100644 --- a/roles/bacula-sd/files/lib/systemd/system/bacula-sd.service +++ b/roles/bacula-sd/files/lib/systemd/system/bacula-sd.service @@ -10,5 +10,15 @@ User=bacula Group=tape ExecStart=/usr/sbin/bacula-sd -c /etc/bacula/bacula-sd.conf +# Hardening +NoNewPrivileges=yes +PrivateDevices=yes +ProtectHome=yes +ProtectSystem=full +ReadOnlyDirectories=/ +ReadWriteDirectories=-/var/lib/bacula +ReadWriteDirectories=-/var/run/bacula +ReadWriteDirectories=/mnt/backup/bacula + [Install] WantedBy=multi-user.target diff --git a/roles/common/files/lib/systemd/system/bacula-fd.service b/roles/common/files/lib/systemd/system/bacula-fd.service index 6e2bbd4..07bd2e5 100644 --- a/roles/common/files/lib/systemd/system/bacula-fd.service +++ b/roles/common/files/lib/systemd/system/bacula-fd.service @@ -8,5 +8,15 @@ PIDFile=/var/run/bacula/bacula-fd.9112.pid StandardOutput=syslog ExecStart=/usr/sbin/bacula-fd -c /etc/bacula/bacula-fd.conf +# Hardening +NoNewPrivileges=yes +PrivateDevices=yes +ProtectHome=read-only +ProtectSystem=full +PrivateTmp=yes +ReadOnlyDirectories=/ +ReadWriteDirectories=-/var/lib +ReadWriteDirectories=-/var/run/bacula + [Install] WantedBy=multi-user.target diff --git a/roles/lists/files/lib/systemd/system/wwsympa.service b/roles/lists/files/lib/systemd/system/wwsympa.service index ea2a78f..b525145 100644 --- a/roles/lists/files/lib/systemd/system/wwsympa.service +++ b/roles/lists/files/lib/systemd/system/wwsympa.service @@ -10,5 +10,14 @@ User=sympa Group=sympa ExecStart=/usr/lib/cgi-bin/sympa/wwsympa.fcgi +# Hardening +NoNewPrivileges=yes +PrivateDevices=yes +ProtectHome=yes +ProtectSystem=full +ReadOnlyDirectories=/ +ReadWriteDirectories=-/var/lib/sympa +ReadWriteDirectories=-/var/run/sympa + [Install] WantedBy=multi-user.target diff --git a/roles/munin-master/files/lib/systemd/system/munin-cgi-graph.service b/roles/munin-master/files/lib/systemd/system/munin-cgi-graph.service index 9e4d820..99aca7a 100644 --- a/roles/munin-master/files/lib/systemd/system/munin-cgi-graph.service +++ b/roles/munin-master/files/lib/systemd/system/munin-cgi-graph.service @@ -10,5 +10,13 @@ User=www-data Group=munin ExecStart=/usr/lib/munin/cgi/munin-cgi-graph +# Hardening +NoNewPrivileges=yes +PrivateDevices=yes +ProtectHome=yes +ProtectSystem=full +ReadOnlyDirectories=/ +ReadWriteDirectories=-/var/log/munin + [Install] WantedBy=multi-user.target diff --git a/roles/munin-master/files/lib/systemd/system/munin-cgi-html.service b/roles/munin-master/files/lib/systemd/system/munin-cgi-html.service index 11a7470..119d3a2 100644 --- a/roles/munin-master/files/lib/systemd/system/munin-cgi-html.service +++ b/roles/munin-master/files/lib/systemd/system/munin-cgi-html.service @@ -10,5 +10,13 @@ User=www-data Group=munin ExecStart=/usr/lib/munin/cgi/munin-cgi-html +# Hardening +NoNewPrivileges=yes +PrivateDevices=yes +ProtectHome=yes +ProtectSystem=full +ReadOnlyDirectories=/ +ReadWriteDirectories=-/var/log/munin + [Install] WantedBy=multi-user.target |