Skip to content

Commit fd1bcd4

Browse files
authored
Merge pull request #30760 from nextcloud/backport/30731/stable22
2 parents 4cf937a + 8db890a commit fd1bcd4

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/private/Security/Bruteforce/Throttler.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,20 @@ public function sleepDelay(string $ip, string $action = ''): int {
350350
public function sleepDelayOrThrowOnMax(string $ip, string $action = ''): int {
351351
$delay = $this->getDelay($ip, $action);
352352
if (($delay === self::MAX_DELAY_MS) && $this->getAttempts($ip, $action, 0.5) > self::MAX_ATTEMPTS) {
353+
$this->logger->info('IP address blocked because it reached the maximum failed attempts in the last 30 minutes [action: {action}, ip: {ip}]', [
354+
'action' => $action,
355+
'ip' => $ip,
356+
]);
353357
// If the ip made too many attempts within the last 30 mins we don't execute anymore
354358
throw new MaxDelayReached('Reached maximum delay');
355359
}
360+
if ($delay > 100) {
361+
$this->logger->info('IP address throttled because it reached the attempts limit in the last 30 minutes [action: {action}, delay: {delay}, ip: {ip}]', [
362+
'action' => $action,
363+
'ip' => $ip,
364+
'delay' => $delay,
365+
]);
366+
}
356367
usleep($delay * 1000);
357368
return $delay;
358369
}

0 commit comments

Comments
 (0)