From 9986797cfa2e0d7fd6d38045998ea4b5c2d09dd0 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sat, 26 Aug 2023 17:03:55 +0100
Subject: [PATCH] Fix the SecAuditLog default directive

---
 docker/build.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docker/build.sh b/docker/build.sh
index 3543435c..b51db234 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -78,7 +78,14 @@ a2ensite ${APACHE_SITES}
 # The file is named 00modsecurity.conf so it is loaded first.
 mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/00modsecurity.conf
 
+# Patch the /etc/modsecurity/00modsecurity.conf file shipped
+# with the packages because it fails with a SyntaxError as
+# soon as it sees the first SecAuditLog directive.
+sed -e 's,^SecAuditLog .*$,SecAuditLog /dev/null,' -i \
+    /etc/modsecurity/00modsecurity.conf
+
 # This needs to be writable for mod security to be able to start.
+# Useless because the float container is read-only anyway.
 install -d -m 1777 /var/log/apache2
 
 # Ensure that the mount points exist.
-- 
GitLab