diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index 06e601eed..02a27ff9e 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -39,7 +39,7 @@ class Attack {} end - req.ip if route[:action].in? %w[email sms] + req.ip if route[:action].in? %w(email sms) end # Inform throttled clients about limits and when they will get out of jail @@ -50,7 +50,8 @@ class Attack if Settings.throttling.notify_honeybadger && ( ((match_data[:limit] - match_data[:count]) < 5) || (match_data[:count] % 10).zero? - ) && (request.env['HTTP_USER_AGENT'] || '') !~ /(Google|bot)/i + ) && (request.env['HTTP_USER_AGENT'] || '') !~ /(Google|bot)/i && + !request.ip&.start_with?(/15\d\./) # ignore abuse from hwclouds (among others) Honeybadger.notify('Throttling request', context: { ip: request.ip, path: request.path }.merge(match_data)) end