From af8880f3a3281612340ec3d38e823684d9af5baa Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 16 May 2020 23:35:25 +0200 Subject: wiki/website: harden config and port to Debian 10. --- .../wiki/files/etc/systemd/system/ikiwiki.service | 23 ++++++++++++++++++++++ roles/wiki/files/etc/systemd/system/ikiwiki.socket | 11 +++++++++++ 2 files changed, 34 insertions(+) create mode 100644 roles/wiki/files/etc/systemd/system/ikiwiki.service create mode 100644 roles/wiki/files/etc/systemd/system/ikiwiki.socket (limited to 'roles/wiki/files/etc/systemd/system') diff --git a/roles/wiki/files/etc/systemd/system/ikiwiki.service b/roles/wiki/files/etc/systemd/system/ikiwiki.service new file mode 100644 index 0000000..3ee7d66 --- /dev/null +++ b/roles/wiki/files/etc/systemd/system/ikiwiki.service @@ -0,0 +1,23 @@ +[Unit] +Description=wiki compiler (CGI script) +Documentation=https://ikiwiki.info/ + +[Service] +User=ikiwiki +Group=ikiwiki +ExecStart=/usr/sbin/fcgiwrap +SyslogIdentifier=ikiwiki +# +# Hardening +NoNewPrivileges=yes +ReadWriteDirectories=/var/lib/ikiwiki/fripost-wiki +ReadWriteDirectories=/var/lib/ikiwiki/public_html/fripost-wiki +PrivateDevices=yes +ProtectHome=yes +ProtectSystem=strict +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes + +[Install] +WantedBy=multi-user.target diff --git a/roles/wiki/files/etc/systemd/system/ikiwiki.socket b/roles/wiki/files/etc/systemd/system/ikiwiki.socket new file mode 100644 index 0000000..8dc1a0e --- /dev/null +++ b/roles/wiki/files/etc/systemd/system/ikiwiki.socket @@ -0,0 +1,11 @@ +[Unit] +Description=wiki compiler (CGI script) +Documentation=https://ikiwiki.info/ + +[Socket] +ListenStream=%t/ikiwiki.socket +SocketUser=www-data +SocketMode=0600 + +[Install] +WantedBy=sockets.target -- cgit v1.2.3