summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 02:05:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 02:05:56 +0000
commitd7226bbc355012012727210b5f1dc6bb6655dbae (patch)
tree8089559e7a8e8d683bd7885dad42987eabf2b134
parentSetting X-Frame-Options to deny. (diff)
downloadapache2-d7226bbc355012012727210b5f1dc6bb6655dbae.tar.xz
apache2-d7226bbc355012012727210b5f1dc6bb6655dbae.zip
Adding configuration file to no accidentally serve git files.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/apache2.postinst2
-rw-r--r--debian/config-dir/conf-available/no-git.conf5
2 files changed, 6 insertions, 1 deletions
diff --git a/debian/apache2.postinst b/debian/apache2.postinst
index e03ee1c..e802575 100644
--- a/debian/apache2.postinst
+++ b/debian/apache2.postinst
@@ -63,7 +63,7 @@ enable_default_conf()
if is_fresh_install $@ ; then
for conf in charset localized-error-pages other-vhosts-access-log \
security serve-cgi-bin \
- csp hsts modern-cookies modern-ssl no-cache no-frames ; do
+ csp hsts modern-cookies modern-ssl no-cache no-frames no-git ; do
a2enconf -m -q $conf
done
fi
diff --git a/debian/config-dir/conf-available/no-git.conf b/debian/config-dir/conf-available/no-git.conf
new file mode 100644
index 0000000..5ff3299
--- /dev/null
+++ b/debian/config-dir/conf-available/no-git.conf
@@ -0,0 +1,5 @@
+# /etc/apache2/conf-available/no-git.conf
+
+<DirectoryMatch "^/.*/\.git*">
+ Require all denied
+</DirectoryMatch>