Debian Codegraph @

doc/sources/admin/samlservice.rst

raw
1 SAML service configuration
2 ==========================
3
4
5 .. note::
6
7 SAML service configuration is a common step to configure LL::NG as
8 :doc:`SAML SP<authsaml>` or :doc:`SAML IDP<idpsaml>`.
9
10 Presentation
11 ------------
12
13 This documentation explains how configure SAML service in LL::NG, in
14 particular:
15
16 - Install prerequisites
17 - Import or generate security keys
18 - Set SAML end points
19
20
21 .. attention::
22
23 Service configuration will be used to generate LL::NG
24 SAML metadata, that will be shared with other providers. It means that
25 if you modify some settings here, you will have to share again the
26 metadata with other providers. In other words, take the time to
27 configure this part before sharing metadata.
28
29 Prerequisites
30 -------------
31
32 Lasso
33 ~~~~~
34
35 |image0|
36
37 SAML2 implementation is based on
38 `Lasso <http://lasso.entrouvert.org>`__. You will need a very recent
39 version of Lasso (>= 2.6.0).
40
41 Debian/Ubuntu
42 ^^^^^^^^^^^^^
43
44 You can use official Debian packages or those available here:
45 http://deb.entrouvert.org/.
46
47
48 .. tip::
49
50 We recommend Lasso 2.6 for the SHA256 support, so use the
51 stretch-testing repository of deb.entrouvert.org.
52
53 You will only need to install liblasso-perl package:
54
55 ::
56
57 apt install liblasso-perl
58
59 RHEL/CentOS/Fedora
60 ^^^^^^^^^^^^^^^^^^
61
62 RPMs are available in LL::NG RPM "extras" repository (see
63 :ref:`installrpm-yum-repository`)
64
65 Then install lasso and lasso-perl packages:
66
67 ::
68
69 yum install lasso lasso-perl
70
71
72 .. attention::
73
74 RHEL9 and derivatives (CentOS 9, AlmaLinux 9, Rocky Linux 9) do not provide
75 SHA-1 support for XML document signature. You will not be able to use SHA-1
76 signature on these distributions.
77
78 Other
79 ^^^^^
80
81 `Download the Lasso tarball <http://lasso.entrouvert.org/download/>`__
82 and compile it on your system.
83
84 Service configuration
85 ---------------------
86
87 Go in Manager and click on ``SAML 2 Service`` node.
88
89
90 .. tip::
91
92 You can use #PORTAL# in values to replace the portal
93 URL.
94
95 Entity Identifier
96 ~~~~~~~~~~~~~~~~~
97
98 Your EntityID, often use as metadata URL, by default
99 #PORTAL#/saml/metadata.
100
101
102 .. note::
103
104 The value will be used in metadata main markup:
105
106 .. code:: xml
107
108 <EntityDescriptor entityID="http://auth.example.com/saml/metadata">
109 ...
110 </EntityDescriptor>
111
112
113
114 .. _samlservice-security-parameters:
115
116 Security parameters
117 ~~~~~~~~~~~~~~~~~~~
118
119 You can define keys for SAML message signature and encryption. If no
120 encryption keys are defined, signature keys are used for signature and
121 encryption.
122
123 To define keys, you can:
124
125 - import your own private and public keys (``Replace by file`` input)
126 - generate new public and private keys (``New certificate`` button)
127
128 .. versionchanged:: 2.0.10
129
130 A X.509 certificate is now generated instead of a plain public key. It has
131 20 years of validity, and is self signed with the 2048 bit RSA key.
132
133 .. tip::
134
135 You can enter a password to protect private key with a
136 password. It will be prompted if you generate keys, else you can set it
137 in the ``Private key password``.
138
139 .. tip::
140
141 You can change default key size by inserting ``defaultNewKeySize = 3072``
142 into lemonldap-ng.ini file.
143
144 |image1|
145
146
147
148 - **Signature method**: set the signature algorithm
149 - **Use certificate in response**: Certificate will be sent inside SAML
150 responses.
151 - **Signing key name**: By default, the key specified in *Security Parameters*
152 will be used for signature. You can use :doc:`anonther key <keys>` instead in
153 order to better manage key rotation. If you declare a comma-separated list,
154 only the first declared key will be used for signature, but all listed keys
155 will be published in SAML metadata.
156 - **Encryption key name**: By default, the key specified in *Security Parameters*
157 will be used for encryption. You can use :doc:`anonther key <keys>` instead in
158 order to better manage key rotation. If you declare a comma-separated list,
159 only the first declared key will be used for encryption, but all listed keys
160 will be published in SAML metadata.
161
162 .. versionchanged:: 2.0.10
163
164 The signature method can now be overridden for a SP or IDP. This will only work
165 if you are using a certificate for signature instead of a public key.
166
167
168 .. attention::
169
170 If you are running a version under 2.0.10, the choice of a signature
171 algorithm will affect all SP and IDP.
172
173
174 .. _samlservice-convert-certificate:
175
176 Converting a RSA public key to a certificate
177 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178
179 If your application complains about the lack of certificate in SAML Metadata, and you generated a public RSA key instead of a certificate in a previous version of LemonLDAP::NG, you can convert the public key into a certificate without changing the private key.
180
181 Save the private key in a file, and use the ``openssl`` commands to
182 issue a self-signed certificate:
183
184 ::
185
186 $ openssl req -new -key private.key -out cert.pem -x509 -days 3650
187
188
189 NameID formats
190 ~~~~~~~~~~~~~~
191
192 SAML can use different NameID formats. The NameID is the main user
193 identifier, carried in SAML messages. You can configure here which field
194 of LL::NG session will be associated to a NameID format.
195
196
197 .. note::
198
199 This parameter is used by :doc:`SAML IDP<idpsaml>` to fill the
200 NameID in authentication responses.
201
202 Customizable NameID formats are:
203
204 - Email
205 - X509
206 - Windows
207 - Kerberos
208
209
210 .. tip::
211
212 For example, if you are using
213 :doc:`AD as authentication backend<authldap>`, you can use
214 sAMAccountName for the Windows NameID format.
215
216 Other NameID formats are automatically managed:
217
218 - **Transient**: NameID is generated
219 - **Persistent**: NameID is restored from previous sessions
220 - **Undefined**: Default NameID format is used
221
222 .. _samlservice-authentication-contexts:
223
224 Authentication contexts
225 ~~~~~~~~~~~~~~~~~~~~~~~
226
227 Each LL::NG authentication module has an authentication level, which can
228 be associated to an `SAML authentication
229 context <http://docs.oasis-open.org/security/saml/v2.0/saml-authn-context-2.0-os.pdf>`__.
230
231 .. note::
232
233 This parameter is used by :doc:`SAML IDP<idpsaml>` to fill the
234 authentication context in authentication responses. It will use the
235 authentication level registered in user session to match the SAML
236 authentication context. It is also used by :doc:`SAML SP<authsaml>` to
237 fill the authentication level in user session, based on authentication
238 response authentication context.
239
240 Standard authentication contexts are:
241
242 - Password
243 - Password protected transport
244 - TLS client
245 - Kerberos
246
247 If you need to map other authentication contexts, you can declare them in extra authentication contexts. For example if you use ADFS, you may need to add ``urn:federation:authentication:windows``.
248
249 Organization
250 ~~~~~~~~~~~~
251
252
253 .. note::
254
255 This concerns all parameters for the Organization metadata
256 section:
257
258 .. code:: xml
259
260 <Organization>
261 <OrganizationName xml:lang="en">Example</OrganizationName>
262 <OrganizationDisplayName xml:lang="en">Example</OrganizationDisplayName>
263 <OrganizationURL xml:lang="en">http://www.example.com</OrganizationURL>
264 </Organization>
265
266
267
268 - **Display Name**: should be displayed on IDP, this is often your
269 society name
270 - **Name**: internal name
271 - **URL**: URL of your society
272
273 Service Provider
274 ~~~~~~~~~~~~~~~~
275
276
277 .. note::
278
279 This concerns all parameters for the Service Provider metadata
280 section:
281
282 .. code:: xml
283
284 <SPSSODescriptor>
285 ...
286 </SPSSODescriptor>
287
288
289 .. _samlservice-general-options:
290
291 General options
292 ^^^^^^^^^^^^^^^
293
294 - **Signed Authentication Request**: set to On to always sign
295 authentication request.
296 - **Want Assertions Signed**: set to On to require that received
297 assertions are signed.
298
299
300 .. tip::
301
302 These options can then be overridden for each Identity
303 Provider.
304
305 Single Logout
306 ^^^^^^^^^^^^^
307
308 For each binding you can set:
309
310 - **Location**: Access Point for SLO request.
311 - **Response Location**: Access Point for SLO response.
312
313 Available bindings are:
314
315 - HTTP Redirect
316 - HTTP POST
317 - HTTP SOAP
318
319 Assertion Consumer
320 ^^^^^^^^^^^^^^^^^^
321
322 For each binding you can set:
323
324 - **Default**: will this binding be used by default for authentication
325 response.
326 - **Location**: Access Point for SSO request and response.
327
328 Available bindings are:
329
330 - HTTP Artifact
331 - HTTP POST
332
333 Artifact Resolution
334 ^^^^^^^^^^^^^^^^^^^
335
336 The only authorized binding is SOAP. This should be set as Default.
337
338 Identity Provider
339 ~~~~~~~~~~~~~~~~~
340
341
342 .. note::
343
344 This concerns all parameters for the Service Provider metadata
345 section:
346
347 .. code:: xml
348
349 <IDPSSODescriptor>
350 ...
351 </IDPSSODescriptor>
352
353
354
355 General parameters
356 ^^^^^^^^^^^^^^^^^^
357
358 * **Want Authentication Request Signed**: By default, LemonLDAP::NG requires all SAML Requests to be signed. Set it to "Off" to let each Service Provider metadata decide if their requests should be verified by LemonLDAP::NG or not.
359
360 .. tip::
361
362 The per-SP "Check SSO message signature" setting allows you to disable
363 signature verification even if this option is set to "On" globally
364
365 This option will set the `WantAuthnRequestsSigned` attribute to `true` in LemonLDAP::NG's IDP Metadata.
366
367 .. warning::
368
369 This setting requires Lasso 2.6.1 to be effective. Older versions behave as if this setting was set to "Off"
370
371 Single Sign On
372 ^^^^^^^^^^^^^^
373
374 For each binding you can set:
375
376 - **Location**: Access Point for SSO request.
377 - **Response Location**: Access Point for SSO response.
378
379 Available bindings are:
380
381 - HTTP Redirect
382 - HTTP POST
383 - HTTP Artifact
384
385 .. _single-logout-1:
386
387 Single Logout
388 ^^^^^^^^^^^^^
389
390 For each binding you can set:
391
392 * **Location**: Access Point for SLO request.
393 * **Response Location**: Access Point for SLO response.
394
395 Available bindings are:
396
397 - HTTP Redirect
398 - HTTP POST
399 - HTTP SOAP
400
401 .. _artifact-resolution-1:
402
403 Artifact Resolution
404 ^^^^^^^^^^^^^^^^^^^
405
406 The only authorized binding is SOAP. This should be set as Default.
407
408 Attribute Authority
409 ~~~~~~~~~~~~~~~~~~~
410
411
412 .. note::
413
414 This concerns all parameters for the Attribute Authority metadata
415 section
416
417 .. code:: xml
418
419 <AttributeAuthorityDescriptor>
420 ...
421 </AttributeAuthorityDescriptor>
422
423
424
425 Attribute Service
426 ^^^^^^^^^^^^^^^^^
427
428 This is the only service to configure, and it accept only the SOAP
429 binding.
430
431 Response Location should be empty, as SOAP responses are directly
432 returned (synchronous binding).
433
434
435 .. _samlservice-saml-sessions-module-name-and-options:
436
437 Sessions
438 ~~~~~~~~
439
440 By default, the main session module is used to store SAML temporary data
441 (like relay-states), but if you need high performance on session access, you
442 should use a dedicated session storage.
443
444 Advanced
445 ~~~~~~~~
446
447 These parameters are not mandatory to run SAML service, but can help to
448 customize it:
449
450 - **UTF8 metadata conversion**: set to On to force partner's metadata
451 conversion.
452 - **RelayState session timeout**: timeout for RelayState sessions. By
453 default, the RelayState session is deleted when it is read. This
454 timeout allows one to purge sessions of lost RelayState.
455 - **Use specific query_string method**: the CGI query_string method may
456 break invalid URL encoded signatures (issued for example by ADFS).
457 This option allows one to use a specific method to extract query
458 string, that should be compliant with non standard URL encoded
459 parameters.
460 - **Override Entity ID when acting as IDP**: By default, SAML entityID
461 is the same for SP and IDP roles. Some federations (like
462 :doc:`Renater<renater>`) can require a different entityID for IDP. In
463 this case, you can fill here the IDP entityID, for example:
464 ``https://auth.example.com/saml/metadata/idp``.
465
466
467 Common Domain Cookie
468 ^^^^^^^^^^^^^^^^^^^^
469
470 The common domain is used by :doc:`SAML SP<authsaml>` to find an
471 Identity Provider for the user, and by :doc:`SAML IDP<idpsaml>` to
472 register itself in user's IDP list.
473
474 Configuration parameters are:
475
476 - **Activation**: Set to On to enable Common Domain Cookie support.
477 - **Common domain**: Name of the common domain (where common cookie is
478 available).
479 - **Reader URL**: URL used by SAML SP to read the cookie. Leave blank
480 to deactivate the feature.
481 - **Writer URL**: URL used by SAML IDP to write the cookie. Leave blank
482 to deactivate the feature.
483
484 .. _samlservice-discovery-protocol:
485
486 Discovery Protocol
487 ^^^^^^^^^^^^^^^^^^
488
489
490 .. note::
491
492 Discovery Protocol is also know as `WAYF
493 Service <http://www.switch.ch/aai/support/tools/wayf.html>`__. More
494 information can be found in the specification:
495 `sstc-saml-idp-discovery-cs-01.pdf <https://www.oasis-open.org/committees/download.php/28049/sstc-saml-idp-discovery-cs-01.pdf>`__.
496
497 When Discovery Protocol is enabled, the LL::NG IDP list is no more used.
498 Instead user is redirected on the discovery service and is redirected
499 back to LL::NG with the chosen IDP.
500
501
502 .. attention::
503
504 If the chosen IDP is not registered in LL::NG, user will
505 be redirected to discovery service again.
506
507 Configuration parameters are:
508
509 - **Activation**: Set to On to enable Discovery Protocol support.
510 - **EndPoint URL**: Discovery service page
511 - **Policy**: Set a value here if you don't want to use the default
512 policy
513 (``urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol:single``)
514 - **Is passive**: Enable this option to avoid user interaction on
515 discovery service page
516
517 .. |image0| image:: /documentation/lasso.png
518 :class: align-center
519 .. |image1| image:: /documentation/manager-saml-signature.png
520 :class: align-center
521
522
523 Federation
524 ^^^^^^^^^^
525
526
527 Import SAML metadata federation files. See :doc:`samlfederation`