Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/private/Security/Bruteforce/Throttler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
use OC\Security\Ip\BruteforceAllowList;
use OC\Security\Normalizer\IpAddress;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\Log\Audit\CriticalActionPerformedEvent;
use OCP\Security\Bruteforce\IThrottler;
use OCP\Security\Bruteforce\MaxDelayReached;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -41,6 +43,7 @@ public function __construct(
private IConfig $config,
private IBackend $backend,
private BruteforceAllowList $allowList,
private IEventDispatcher $dispatcher,
) {
}

Expand All @@ -58,6 +61,12 @@ public function registerAttempt(string $action,

$ipAddress = new IpAddress($ip);
if ($this->isBypassListed((string)$ipAddress)) {
$this->dispatcher->dispatchTyped(
new CriticalActionPerformedEvent(
'Bruteforce attempt from "{ip}" detected for action "{action}" not throttled due to allow-list.',
['ip' => $ip, 'action' => $action],
)
);
return;
}

Expand Down
Loading