aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2024-09-03 15:27:10 -0700
committerDan Fandrich <danf@mageia.org>2024-09-03 15:32:23 -0700
commit89c56e1cd4acff104cd67f72309938e5ca646793 (patch)
tree8b91131a755a99964a572254d4c9b04ef40f6062 /modules
parent62fdd8ddb53d9c43be9603ef3d4bb981f5430ca4 (diff)
downloadpuppet-89c56e1cd4acff104cd67f72309938e5ca646793.tar
puppet-89c56e1cd4acff104cd67f72309938e5ca646793.tar.gz
puppet-89c56e1cd4acff104cd67f72309938e5ca646793.tar.bz2
puppet-89c56e1cd4acff104cd67f72309938e5ca646793.tar.xz
puppet-89c56e1cd4acff104cd67f72309938e5ca646793.zip
Block expensive SVN operations on robots on svnweb
This will result in most operations other than showing a directory or downloading a specific version of a file being blocked. ClaudeBot and Amazonbot remain completely blocked.
Diffstat (limited to 'modules')
-rw-r--r--modules/apache/templates/vhost_fcgid.conf8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/apache/templates/vhost_fcgid.conf b/modules/apache/templates/vhost_fcgid.conf
index 17b2bb06..c44f9ea6 100644
--- a/modules/apache/templates/vhost_fcgid.conf
+++ b/modules/apache/templates/vhost_fcgid.conf
@@ -13,4 +13,12 @@ FcgidIdleTimeout 30
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ClaudeBot|Amazonbot
RewriteRule . - [R=403,L]
+
+# Block expensive SVN operations on all common robots ("spider" covers a
+# bunch). "Expensive" is considered to be most operations other than showing a
+# directory or downloading a specific version of a file.
+RewriteCond %{QUERY_STRING} pathrev=|annotate=|view=log|r1=
+RewriteCond %{HTTP_USER_AGENT} "Googlebot|bingbot|Yahoo! Slurp|ClaudeBot|Amazonbot|YandexBot|SemrushBot|Barkrowler|DataForSeoBot|PetalBot|facebookexternalhit|GPTBot|spider|Spider"
+RewriteRule . - [R=403,L]
+
ErrorDocument 403 "<html><body>Impolite robots are not allowed</body></html>"