Debian Codegraph @

doc/sources/admin/riskbased.rst

raw
1 Risk-based Authentication
2 =========================
3
4 Our definition
5 --------------
6
7 Risk-based authentication is the ability to take into account the context of
8 the authentication process, and react accordingly, by increasing the
9 authentication challenge (second factor, email confirmation) or trigger out of
10 band actions (email notifications, alerts..).
11
12 .. warning::
13
14 All the features presented on this page are not natively supported by
15 LemonLDAP::NG but can be added through custom plugins or configuration
16
17 The authentication context can include:
18
19 * Source IP address
20 * Access time
21 * Previous authentications (history)
22 * Using the same browser as previous logins
23
24 Reactions can include:
25
26 * Triggering or skipping the second factor
27 * Sending an email to warn the user of a suspicious login
28 * Denying attempt if the suspicion level is too high
29
30 Implementation in LemonLDAP::NG
31 -------------------------------
32
33 LemonLDAP::NG uses the ``_riskLevel`` and ``_riskDetails`` session variables to
34 keep track of the risk associated to the current authentication.
35
36 Detection plugins will raise or lower the risk level, and store fine-grained
37 details in the risk details object.
38
39 Action plugins may use the risk level to trigger certain actions, and can
40 translate the risk detail items into user-friendly messages.
41
42
43 Compatible plugins
44 ------------------
45
46 Detection
47 ~~~~~~~~~
48
49 New location warning
50 ^^^^^^^^^^^^^^^^^^^^
51
52 .. versionadded:: 2.0.14
53
54 The :doc:`New Location warning <newlocationwarning>` plugin will increase the risk level by 1 when triggered, and will store the **Session attribute to display** in ``$_riskDetail->{newLocation}``.
55
56 Action
57 ~~~~~~
58
59 Forbidding/triggering second factors
60 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
62 You can use the following activation rule to trigger second factors if the risk level is high::
63
64 $_riskLevel > 0
65
66 Or, if you use self registration::
67
68 has2f('TOTP') and $_riskLevel > 0
69
70 Denying login
71 ^^^^^^^^^^^^^
72
73 You can use :doc:`session opening conditions <grantsession>` to deny access if the risk level is too high with a rule like this ::
74
75 $_riskLevel < 2
76
77 This will forbid sessions from being opened if the risk level is greater or equal to 2