From 89c56e1cd4acff104cd67f72309938e5ca646793 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 3 Sep 2024 15:27:10 -0700 Subject: 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. --- modules/apache/templates/vhost_fcgid.conf | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/apache/templates/vhost_fcgid.conf') 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 "Impolite robots are not allowed" -- cgit v1.2.1