Add error log for authentication failure to allow fail2ban integration
This commit is contained in:
parent
e9c452099e
commit
da3d993243
|
|
@ -97,11 +97,17 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
|
||||||
$username = $event->getUsername();
|
$username = $event->getUsername();
|
||||||
|
|
||||||
if (! empty($username)) {
|
if (! empty($username)) {
|
||||||
|
// log login failure in web server log to allow fail2ban usage
|
||||||
|
error_log('Kanboard: user '.$username.' authentication failure');
|
||||||
$this->userLockingModel->incrementFailedLogin($username);
|
$this->userLockingModel->incrementFailedLogin($username);
|
||||||
|
|
||||||
if ($this->userLockingModel->getFailedLogin($username) > BRUTEFORCE_LOCKDOWN) {
|
if ($this->userLockingModel->getFailedLogin($username) > BRUTEFORCE_LOCKDOWN) {
|
||||||
$this->userLockingModel->lock($username, BRUTEFORCE_LOCKDOWN_DURATION);
|
$this->userLockingModel->lock($username, BRUTEFORCE_LOCKDOWN_DURATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// log login failure in web server log to allow fail2ban usage
|
||||||
|
error_log('Kanboard: user Unknown authentication failure');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue