summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-06-21 18:38:04 +0200
committerGitHub <noreply@github.com>2018-06-21 18:38:04 +0200
commit2d32435a977418443cb498c15f1283fd9111b424 (patch)
tree4d630f214f3715081da6063902c53d88fe98e5e8
parent1024d9b797217682cba6d89e484620782a7bb327 (diff)
downloadbugzilla-2d32435a977418443cb498c15f1283fd9111b424.tar.gz
bugzilla-2d32435a977418443cb498c15f1283fd9111b424.tar.xz
Bug 1393146 - Automate blocking IPs that bugzilla flags as exceeding rate limits
-rw-r--r--Bugzilla.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 427dd3aea..ad8019a99 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -862,7 +862,10 @@ sub check_rate_limit {
}
my $limit = join("/", @$limit);
Bugzilla->audit("[rate_limit] action=$action, ip=$ip, limit=$limit, name=$name");
- ThrowUserError("rate_limit") if $action eq 'block';
+ if ($action eq 'block') {
+ Bugzilla::ModPerl::BlockIP->block_ip($ip);
+ ThrowUserError("rate_limit");
+ }
}
}
}