summaryrefslogtreecommitdiff
path: root/app/Subscriber
diff options
context:
space:
mode:
authordoc75 <github@virlet.org>2018-02-20 01:55:57 +0100
committerfguillot <fred@kanboard.net>2018-02-19 16:55:57 -0800
commitda3d99324355ea1bfe2ece28751f0dec2f7bb441 (patch)
tree1afec137b7ef42229186028dd2f9fb937cefee0b /app/Subscriber
parente9c452099ee0ef6578780804067d100ddba964a1 (diff)
Add error log for authentication failure to allow fail2ban integration
Diffstat (limited to 'app/Subscriber')
-rw-r--r--app/Subscriber/AuthSubscriber.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Subscriber/AuthSubscriber.php b/app/Subscriber/AuthSubscriber.php
index 5f22edab..3f6ad05a 100644
--- a/app/Subscriber/AuthSubscriber.php
+++ b/app/Subscriber/AuthSubscriber.php
@@ -97,11 +97,17 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
$username = $event->getUsername();
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);
if ($this->userLockingModel->getFailedLogin($username) > BRUTEFORCE_LOCKDOWN) {
$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');
+ }
}
}