Debian Codegraph @

doc/sources/admin/bruteforceprotection.rst

raw
1 Brute Force Protection plugin
2 =============================
3
4 This plugin prevents brute force attack. Plugin DISABLED by default.
5
6 After some failed login attempts, user must wait before trying to log in
7 again.
8
9 The aim of a brute force attack is to gain access to user accounts by
10 repeatedly trying to guess the password of an user. If disabled,
11 automated tools may submit thousands of password attempts in a matter of
12 seconds.
13
14 .. attention::
15 This plugin relies on the Login History, stored in users' persistent sessions.
16 This means that the authentication and persistent session backends will be
17 accessed for every login attempt, even fraudulent ones. This plugin is not
18 meant to protect against denial of service attacks.
19
20
21 Configuration
22 -------------
23
24 To enable Brute Force Attack protection:
25
26 Go in Manager, ``General Parameters`` » ``Advanced Parameters`` »
27 ``Security`` » ``Brute-force attack protection`` » ``Activation``\ and
28 set to ``On``.
29
30 - **Parameters**:
31
32 - **Activation**: Enable/disable brute force attack protection
33 - **Lock time**: Waiting time before another login attempt
34 - **Allowed failed login**: Number of failed login attempts allowed before account is locked
35 - **Incremental lock**: Enable/disable incremental lock times
36 - **Incremental lock times**: List of comma separated lock time values in seconds
37 - **Maximum lock time**: Lock time values can not be higher than max lock time
38 - **Maximum age**: Delta between current and last stored failed login
39
40
41 Incremental lock time enabled
42 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
44 You just have to activate it in the Manager :
45
46 Go in Manager, ``General Parameters`` » ``Advanced Parameters`` »
47 ``Security`` » ``Brute-force attack protection`` »
48 ``Incremental lock times`` and set to ``On``. (DISABLED by default) or
49 in ``lemonldap-ng.ini`` [portal] section:
50
51 .. code-block:: ini
52
53 [portal]
54 bruteForceProtectionIncrementalTempo = 1
55
56 Lock time increases between each failed login attempt after allowed failed logins.
57
58 .. code-block:: ini
59
60 [portal]
61 bruteForceProtectionLockTimes = 5, 15, 60, 300, 600
62 bruteForceProtectionMaxLockTime = 900
63
64 **How it works:**
65
66 The lock times list is prepended with zeros for the allowed failed logins.
67 For example, with ``bruteForceProtectionMaxFailed = 3`` and
68 ``bruteForceProtectionLockTimes = 300, 600, 900``, the effective list becomes:
69 ``[0, 0, 300, 600, 900]``.
70
71 The lock time is determined by the number of recent failed logins:
72
73 - 1st and 2nd failed login: no lock (lock time = 0)
74 - 3rd failed login: locked for 300 seconds (5 minutes)
75 - 4th failed login: locked for 600 seconds (10 minutes)
76 - And so on...
77
78 When a user is locked, they must wait for the lock time to expire before
79 attempting to log in again. Login attempts while locked (even with the
80 correct password) are rejected but do **not** increase the failed login
81 counter.
82
83 .. note::
84
85 Max lock time value is used if a lock time is missing
86 (number of failed logins higher than listed lock time values).
87 Lock time values higher than or equal to max lock time are ignored
88 (a warning is logged).
89
90
91 Incremental lock time disabled
92 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93
94 After allowed failed login attempts, user must wait
95 the lock time before trying to log in again.
96
97
98 .. attention::
99 Number of failed login attempts history must be higher than
100 the number of incremental lock time values plus allowed failed login attempts.
101 The incremental lock time values list will be truncated if not.
102
103
104 .. danger::
105 Number of failed login attempts stored in history MUST
106 be higher than allowed failed logins for this plugin takes effect.
107 See :doc:`History plugin<loginhistory>`