From da3d99324355ea1bfe2ece28751f0dec2f7bb441 Mon Sep 17 00:00:00 2001 From: doc75 Date: Tue, 20 Feb 2018 01:55:57 +0100 Subject: Add error log for authentication failure to allow fail2ban integration --- app/Subscriber/AuthSubscriber.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') 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'); + } } } -- cgit v1.2.3