Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-01-20 12:35:07 +0300
committerGitHub <noreply@github.com>2022-01-20 12:35:07 +0300
commitfd1bcd434c56d9bae998b032001931881c36c78f (patch)
treeb2612f8cfa475280f507b8002398eaa94189c073
parent4cf937ad817577717f9171e67fc230e2d1e0f612 (diff)
parent8db890a6215b30559f26869fa39daafd2109d555 (diff)
Merge pull request #30760 from nextcloud/backport/30731/stable22
-rw-r--r--lib/private/Security/Bruteforce/Throttler.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php
index 6c898cdf7e6..411a8a0763d 100644
--- a/lib/private/Security/Bruteforce/Throttler.php
+++ b/lib/private/Security/Bruteforce/Throttler.php
@@ -350,9 +350,20 @@ class Throttler {
public function sleepDelayOrThrowOnMax(string $ip, string $action = ''): int {
$delay = $this->getDelay($ip, $action);
if (($delay === self::MAX_DELAY_MS) && $this->getAttempts($ip, $action, 0.5) > self::MAX_ATTEMPTS) {
+ $this->logger->info('IP address blocked because it reached the maximum failed attempts in the last 30 minutes [action: {action}, ip: {ip}]', [
+ 'action' => $action,
+ 'ip' => $ip,
+ ]);
// If the ip made too many attempts within the last 30 mins we don't execute anymore
throw new MaxDelayReached('Reached maximum delay');
}
+ if ($delay > 100) {
+ $this->logger->info('IP address throttled because it reached the attempts limit in the last 30 minutes [action: {action}, delay: {delay}, ip: {ip}]', [
+ 'action' => $action,
+ 'ip' => $ip,
+ 'delay' => $delay,
+ ]);
+ }
usleep($delay * 1000);
return $delay;
}