From 0ceabfe7c18d1929e3dae9730716e24a9694a70e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 24 Jan 2024 08:31:24 +0000 Subject: [PATCH] Add fail2ban block for repeated timeouts on the trackpoints API call --- cookbooks/web/recipes/frontend.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cookbooks/web/recipes/frontend.rb b/cookbooks/web/recipes/frontend.rb index 6c1f0f761..84923ee89 100644 --- a/cookbooks/web/recipes/frontend.rb +++ b/cookbooks/web/recipes/frontend.rb @@ -75,6 +75,16 @@ fail2ban_jail "apache-request-timeout" do ports [80, 443] end +fail2ban_filter "apache-trackpoints-timeout" do + failregex '^ .* "GET /api/0\.6/trackpoints\?.*" 408 .*$' +end + +fail2ban_jail "apache-trackpoints-timeout" do + filter "apache-trackpoints-timeout" + logpath "/var/log/apache2/access.log" + ports [80, 443] +end + fail2ban_filter "apache-notes-search" do failregex '^ .* "GET /api/0\.6/notes/search\?q=abcde&.*$' end -- 2.39.5