Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
adjusts the delay and allowed-attempts threshold; optional progressive
(exponential) block duration for repeat offenders; password reset/
username reminder now stay reachable even for a blocked IP
- Notifications of failed logins only for existing accounts (#172): the new
setting "Failed msgs only for existing accounts" restricts the failed
login notification to attempts with a username or email address which
belongs to a registered account; attempts with other names are still
recorded and counted towards blocking
- Local GeoIP lookup (issue #169): "Information for IP Address" in the
component now shows real country/region/city/coordinates again via a
locally-configured MaxMind .mmdb database, instead of the discontinued
Expand Down
2 changes: 2 additions & 0 deletions language/de-DE/de-DE.plg_system_bfstop.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ PLG_SYSTEM_BFSTOP_EMAIL_ADDRESS_LABEL="Email-Adresse(n)"
PLG_SYSTEM_BFSTOP_EMAIL_ADDRESS_DESC="Die Email-Adresse(n) eingeben, an die die Benachrichtigungen gesendet werden sollen. Wenn mehrere Adressen eingegeben werden, m眉ssen diese durch einen Strichpunkt (;) getrennt werden."
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_NUMBER_LABEL="Fehlgeschlagen-Nachrichten"
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_NUMBER_DESC="Wie oft an einem Tag maximal eine Benachrichtigung 眉ber fehlgeschlagene Login-Versuche gesendet werden soll."
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_ONLY_EXISTING_LABEL="Fehlgeschlagen-Nachrichten nur f眉r existierende Konten"
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_ONLY_EXISTING_DESC="Nur dann 眉ber einen fehlgeschlagenen Login-Versuch benachrichtigen, wenn der eingegebene Benutzername (oder die E-Mail-Adresse) zu einem existierenden Konto geh枚rt. Versuche mit Namen, die auf dieser Seite nicht registriert sind (typischerweise Bots, die Benutzernamen raten), werden weiterhin aufgezeichnet und f眉r das Blockieren mitgez盲hlt, l枚sen aber keine Benachrichtigung aus."
PLG_SYSTEM_BFSTOP_NOTIFY_BLOCKED_NUMBER_LABEL="Blockiert-Nachrichten"
PLG_SYSTEM_BFSTOP_NOTIFY_BLOCKED_NUMBER_DESC="Wie oft an einem Tag maximal eine Benachrichtigung 眉ber blockierte IP-Adressen gesendet werden soll."
PLG_SYSTEM_BFSTOP_DELAY_DURATION_LABEL="Verz枚gerung"
Expand Down
2 changes: 2 additions & 0 deletions language/en-GB/en-GB.plg_system_bfstop.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ PLG_SYSTEM_BFSTOP_EMAIL_ADDRESS_LABEL="Email Address(es)"
PLG_SYSTEM_BFSTOP_EMAIL_ADDRESS_DESC="Enter the Email Address(es) where you would like to have notifications to be sent. If you want to specify more than one address, separate them by the semicolon character (;)."
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_NUMBER_LABEL="Failed msgs per day"
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_NUMBER_DESC="How often to notify about a failed login during one day"
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_ONLY_EXISTING_LABEL="Failed msgs only for existing accounts"
PLG_SYSTEM_BFSTOP_NOTIFY_FAILED_ONLY_EXISTING_DESC="Only notify about a failed login if the username (or email address) which was entered belongs to an existing account. Attempts with names which are not registered on this site (typically bots guessing usernames) are still recorded and counted towards blocking, but do not trigger a notification."
PLG_SYSTEM_BFSTOP_NOTIFY_BLOCKED_NUMBER_LABEL="Blocked msgs per day"
PLG_SYSTEM_BFSTOP_NOTIFY_BLOCKED_NUMBER_DESC="How often to notify about a blocked IP during one day"
PLG_SYSTEM_BFSTOP_DELAY_DURATION_LABEL="Delay"
Expand Down
14 changes: 12 additions & 2 deletions src/Extension/Bfstop.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,18 @@ public function onUserLoginFailure($event)

$this->notifyOfRemainingAttempts($logEntry, $riskScore);

$maxNumber = $this->getIntParam('notifyFailedNumber', 0);
$this->notifier->failedLogin($logEntry, $maxNumber);
// $username is what was typed; the entry only holds a hash of it if
// it isn't an account (see usernameForStorage())
if ($this->getBoolParam('notifyFailedOnlyExisting', false) &&
!$this->mydb->accountExists($username))
{
$this->logger->log('Not notifying of failed login: the username does not belong to an account', Log::DEBUG);
}
else
{
$maxNumber = $this->getIntParam('notifyFailedNumber', 0);
$this->notifier->failedLogin($logEntry, $maxNumber);
}
$this->blockIfTooManyAttempts($logEntry, $riskScore);

$delayDuration = $this->accountThrottleDelay($logEntry) + $this->determineDelayDuration($riskScore);
Expand Down
Loading