Koha/koha-tmpl/intranet-tmpl/prog/en/modules
Jonathan Druart cfc484b173 Bug 18314: Account lockout
To prevent brute force attacks on Koha accounts, staff and opac, we need to
implement an account lockout process to Koha.

After a number of failed login attempts a users account would become locked.
The user would then need to use the reset password functionality to send a reset
token to their email account. After a successful password reset the lockout flag
would be removed.

The number of failed login attempts before lockout is configurable using a new
system preference 'FailedLoginAttempts'.

How does it work?
When a patron enter an invalid password, the borrowers.login_attempts value
for this patron is incremented. When this value reach the value of the
pref FailedLoginAttempts, the password comparison is not done and the
authentication is rejected.
This login_attempts field is reset when a patron correctly logs in. When
the account is locked the patron has to reset his/her password using
the OpacResetPassword feature or ask a staff member to generate a new
password.
If the pref is not set (0, or '') the feature is considered as disabled,
but the failed login attempts are stored anyway.

Test plan:
0/ Apply patch and execute the update DB entry
1/ Switch on the feature by setting FailedLoginAttempts to 3
2/ Use an invalid password to login at the staff or OPAC interface
3/ After the third consecutive failures, you will be asked to reset your
password if OpacResetPassword is set, or contact a staff member
4/ Switch on OpacResetPassword and reset your password
5/ Confirm that you are able to login
6/ Play with the different combinations

QA details: The trick happens in C4::Auth::checkpw, to make things clear
I had to create a return value (note the awesome name: @return) and
replace the 3 successives if statements with elsif. Indeed if one of
the condition is reached, it will return inside the given block.

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-12 10:58:44 -04:00
..
acqui Bug 18525: (bug 14828 follow-up) FIX ordering from suggestion when item-level_itypes = biblio 2017-05-12 08:50:40 -04:00
admin Bug 18314: Add pref FailedLoginAttempts and columns borrowers.login_attempts 2017-05-12 10:58:35 -04:00
authorities Bug 18019: [QA Follow-up] Also catch the delete from authorities detail 2017-03-31 13:08:24 +00:00
basket
batch
catalogue Bug 18554: Adjust a few typos including responsability 2017-05-09 21:03:22 +00:00
cataloguing Bug 18432 : Follow up - Updating to use they/them 2017-04-21 10:56:43 -04:00
circ Bug 15582: Ability to block auto renewals if OPACFineNoRenewals is reached 2017-05-09 21:05:29 +00:00
clubs Bug 18529 - Template cleanup of patron clubs pages 2017-05-12 09:02:28 -04:00
common Bug 13835: Popup with searches: results hidden by language menu in footer 2017-04-28 08:35:30 -04:00
course_reserves Bug 18264 - (QA Followup) Remove use of GetBiblioFromItemNumber Replace <blank> with (blank) 2017-03-22 19:04:43 +00:00
errors
help Bug 18554: Adjust a few typos including responsability 2017-05-09 21:03:22 +00:00
installer Bug 17942 [Follow-up] Update style of the web installer with Bootstrap 3 2017-05-09 20:54:31 +00:00
labels
members Bug 17762: Add the lang attribute to the patron form 2017-05-09 20:56:40 +00:00
offline_circ
onboarding Bug 17942 [Follow-up] Update style of the web installer with Bootstrap 3 2017-05-09 20:54:31 +00:00
patron_lists
patroncards Bug 15815: Reword confirm message when removing patrons from card batch 2017-04-24 13:25:40 -04:00
plugins
reports Bug 17465: NumSavedReports syspref 2017-05-09 21:17:53 +00:00
reserve Bug 12063 - Remove Koha::Hold::waiting_expires_on since dateexpiration is set on database 2017-05-09 08:59:39 -04:00
reviews
rotating_collections
serials Bug 18035: Front-end changes to serials -> numbering patterns 2017-05-09 20:55:56 +00:00
services
sms
suggestion
tags
test
tools Bug 17762: Fix sql fields insertion 2017-05-09 20:56:42 +00:00
virtualshelves Bug 13835: Popup with searches: results hidden by language menu in footer 2017-04-28 08:35:30 -04:00
about.tt Bug 18302: Release team 17.05 2017-03-31 14:16:58 +00:00
auth.tt Bug 18314: Account lockout 2017-05-12 10:58:44 -04:00
intranet-main.tt Bug 17855: Onboarding tool 2017-04-28 08:36:19 -04:00