From f070b4b8d54149f04b97e8e29a20860afdef1883 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 9 Jun 2025 17:42:50 +0100 Subject: [PATCH] git: block fake scraper on even more urls --- cookbooks/git/templates/default/apache.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cookbooks/git/templates/default/apache.erb b/cookbooks/git/templates/default/apache.erb index 843503717..34456bbf1 100644 --- a/cookbooks/git/templates/default/apache.erb +++ b/cookbooks/git/templates/default/apache.erb @@ -70,7 +70,10 @@ # Prevent abuse by an anonymous AI bot RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)$ RewriteCond %{REQUEST_URI} ^/[^/]+\.git/blob [OR] + RewriteCond %{REQUEST_URI} ^/[^/]+\.git/commitdiff [OR] RewriteCond %{REQUEST_URI} ^/[^/]+\.git/history [OR] + RewriteCond %{REQUEST_URI} ^/[^/]+\.git/patch [OR] + RewriteCond %{REQUEST_URI} ^/[^/]+\.git/search [OR] RewriteCond %{REQUEST_URI} ^/[^/]+\.git/tree RewriteCond %{HTTP_REFERER} ^-?$ RewriteCond %{HTTP_USER_AGENT} ((CriOS|Chrome)/[1-9][0-9]?\.0\.|Chrome/100\.0\.|Chrome/122\.0\.0\.0|(Firefox|FxiOS)/[1-6]?[0-9]\.|MSIE\ [5-9]\.0|Opera/[8-9]\.|Windows\ NT\ [3-5]\.|Version/[3-5]\.[0-1]) [NC] -- 2.39.5