Debian Codegraph @

doc/sources/admin/webauthn2f.rst

raw
1 WebAuthn as a second factor
2 ===========================
3
4 `Web Authentication <https://www.w3.org/TR/webauthn/>`__ , shortened as WebAuthn, is a standard method by which a web browser can authenticate to an application (*Relying Party*, in our case, this is LemonLDAP::NG) through the use of an *Authenticator*, which can be a hardware token (USB, NFC...) or provided by the user's device itself (TPM).
5
6 .. tip::
7
8 If you want to use Webauthn as first factor (also called `passwordless`), see :doc:`dedicated documentation<authwebauthn>`.
9
10 Implementation status
11 ~~~~~~~~~~~~~~~~~~~~~
12
13 Currently, we implement:
14
15 * Device registration without attestation validation (attestation type: *None*)
16 * Authentication as a second factor with the registered device
17
18 Requirements
19 ~~~~~~~~~~~~
20
21 You need to install the `Authen::WebAuthn` CPAN module for WebAuthn to work on
22 your LemonLDAP::NG installation.
23
24 For Debian::
25
26 apt install libauthen-webauthn-perl
27
28 For RHEL (>=8)::
29
30 dnf install perl-Authen-WebAuthn
31
32 If there is no package for it in your distribution, you can install it with::
33
34 cpanm Authen::WebAuthn
35
36 Configuration
37 ~~~~~~~~~~~~~
38
39 - **Activation**: Set it to "on".
40 - **Self registration**: set it to "on" if users are authorized to register their keys
41 - **Allow user to remove WebAuthn**: if enabled, user can unregister their WebAuthn devices
42 - **User verification**: Whether or not LemonLDAP::NG requires the user to
43 authenticate to their second factor device. Usually by entering a PIN code.
44 *Warning*: The *Required* option is not supported by older U2F security keys.
45 - **Use discoverable credential**: a private key that is associated with a user handle is generated on the authenticator
46 - **Attestation**: Type of attestation to request from the authenticator. After
47 enabling this you need to specify a list of trusted certificates
48 - **Attestation trusted certificates**: A concatenation of PEM certificates
49 that you trust for attestation
50 - **Relying Party display name**: how the LemonLDAP::NG server will appear in
51 the web browser messages displayed to the user
52 - **Relying Party ID**: The domain name on which WebAuthn devices can be
53 registered and used. It must be a non-public suffix of the portal's hostname.
54 - **Send U2F AppID**: send the string that declares which facets that belong to this application
55 - **User Display Name attribute**: session attribute containing user display name
56 - **Default transports**: Comma-separated list of transport hints sent to the
57 web browser, if none are provided during registration
58 - **Authentication level**: you can overwrite here auth level for
59 WebAuthn registered users. Leave it blank keeps auth level provided by
60 first authentication module *(default: 2 for user/password based
61 modules)*. **It is recommended to set an higher value here if you
62 want to give access to some apps only for enrolled users**
63 - **Label** (Optional): label that should be displayed to the user on
64 the choice screen
65 - **Logo** (Optional): logo file *(in static/<skin> directory)*
66
67
68 .. attention::
69 If you want to use a custom rule for "activation" and want to keep self-registration,
70 you must add the following condition to the custom activation rule::
71
72 and has2f('WebAuthn')
73
74 Without this condition, WebAuthn device will be asked even for users who didn't register one.
75 This is automatically done when "activation" is simply set to "on".
76
77
78 Provisioning
79 ------------
80
81 If you don't want to use self-registration, set public part of user's
82 yubikey in Second Factor Devices array (JSON) in your user-database.
83 Then map it to the \_2fDevices attribute (see
84 :doc:`exported variables<exportedvars>`):
85
86 .. code::
87
88 [{"name" : "MyFIDO2" , "type" : "WebAuthn" , "epoch":"1524078936"}, ...]
89
90
91
92 .. _migrateu2ftowebauthn:
93
94 Migrating existing U2F devices
95 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96
97 WebAuthn is compatible with both FIDO and FIDO2 standards. Which means this
98 module lets you use any U2F-compatible device you already own.
99
100 You can use the ``lemonldap-ng-sessions`` tool to migrate existing U2F devices to the WebAuthn plugin ::
101
102 # For one user
103 lemonldap-ng-sessions secondfactors migrateu2f dwho
104
105 # For all users
106 lemonldap-ng-sessions secondfactors migrateu2f --all
107
108 Once you are satisfied with WebAuthn, you can remove existing U2F devices and
109 disable the U2F second factor module ::
110
111 # For one user
112 lemonldap-ng-sessions secondfactors delType dwho U2F
113
114 # For all users
115 lemonldap-ng-sessions secondfactors delType --all U2F