Skip to content

Commit 36c3376

Browse files
(DOCSP-11271): Add LDAP authentication (#325)
* (DOCSP-11271): Add LDAP authentication * Copy review
1 parent 9e8c26f commit 36c3376

File tree

3 files changed

+184
-8
lines changed

3 files changed

+184
-8
lines changed

source/includes/options-k8s-replica-set.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,69 @@ inherit:
366366
file: options-k8s-shared.yaml
367367
---
368368
program: k8sRsConf
369+
name: spec.security.authentication.ldap
370+
inherit:
371+
name: spec.security.authentication.ldap
372+
program: _shared
373+
file: options-k8s-shared.yaml
374+
---
375+
program: k8sRsConf
376+
name: spec.security.authentication.ldap.servers
377+
inherit:
378+
name: spec.security.authentication.ldap.servers
379+
program: _shared
380+
file: options-k8s-shared.yaml
381+
---
382+
program: k8sRsConf
383+
name: spec.security.authentication.ldap.transportSecurity
384+
inherit:
385+
name: spec.security.authentication.ldap.transportSecurity
386+
program: _shared
387+
file: options-k8s-shared.yaml
388+
---
389+
program: k8sRsConf
390+
name: spec.security.authentication.ldap.caConfigMapRef
391+
inherit:
392+
name: spec.security.authentication.ldap.caConfigMapRef
393+
program: _shared
394+
file: options-k8s-shared.yaml
395+
---
396+
program: k8sRsConf
397+
name: spec.security.authentication.ldap.caConfigMapRef.name
398+
inherit:
399+
name: spec.security.authentication.ldap.caConfigMapRef.name
400+
program: _shared
401+
file: options-k8s-shared.yaml
402+
---
403+
program: k8sRsConf
404+
name: spec.security.authentication.ldap.caConfigMapRef.key
405+
inherit:
406+
name: spec.security.authentication.ldap.caConfigMapRef.key
407+
program: _shared
408+
file: options-k8s-shared.yaml
409+
---
410+
program: k8sRsConf
411+
name: spec.security.authentication.ldap.bindQueryUser
412+
inherit:
413+
name: spec.security.authentication.ldap.bindQueryUser
414+
program: _shared
415+
file: options-k8s-shared.yaml
416+
---
417+
program: k8sRsConf
418+
name: spec.security.authentication.ldap.bindQueryPasswordSecretRef
419+
inherit:
420+
name: spec.security.authentication.ldap.bindQueryPasswordSecretRef
421+
program: _shared
422+
file: options-k8s-shared.yaml
423+
---
424+
program: k8sRsConf
425+
name: spec.security.authentication.ldap.bindQueryPasswordSecretRef.name
426+
inherit:
427+
name: spec.security.authentication.ldap.bindQueryPasswordSecretRef.name
428+
program: _shared
429+
file: options-k8s-shared.yaml
430+
---
431+
program: k8sRsConf
369432
name: spec.additionalMongodConfig.net.ssl.mode
370433
inherit:
371434
name: spec.additionalMongodConfig.net.ssl.mode

source/includes/options-k8s-shared.yaml

Lines changed: 110 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,14 +538,17 @@ directive: setting
538538
optional: true
539539
description: |
540540
Specifies the authentication mechanism that your MongoDB deployment
541-
uses. Valid values are ``SCRAM`` and ``X509``.
541+
uses. Valid values are ``SCRAM``, ``X509``, and ``LDAP``.
542542
543-
To enable :ref:`X.509 internal cluster authentication
544-
<x509-internal-authentication>` for the |com| project, set this value
545-
to ``["X509"]`` and specify the following settings:
543+
.. admonition:: X.509 Internal Cluster Authentication
544+
:class: note
546545
547-
- :setting:`spec.security.authentication.internalCluster` ``: "X509"``
548-
- :setting:`spec.security.tls.enabled` ``: true``
546+
To enable :ref:`X.509 internal cluster authentication
547+
<x509-internal-authentication>` for the |com| project, set this
548+
value to ``["X509"]`` and specify the following settings:
549+
550+
- :setting:`spec.security.authentication.internalCluster` ``: "X509"``
551+
- :setting:`spec.security.tls.enabled` ``: true``
549552
550553
---
551554
program: _shared
@@ -574,6 +577,107 @@ description: |
574577
To manage database users directly through the |mongod| or |mongos|, set to ``true``.
575578
---
576579
program: _shared
580+
name: spec.security.authentication.ldap
581+
type: collection
582+
directive: setting
583+
optional: true
584+
description: |
585+
*Required for LDAP authentication.*
586+
587+
Configures |ldap| authentication for the |com| project. To enable
588+
|ldap| authentication, set
589+
:setting:`spec.security.authentication.modes` to ``["LDAP"]``.
590+
---
591+
program: _shared
592+
name: spec.security.authentication.ldap.servers
593+
type: string
594+
directive: setting
595+
description: |
596+
*Required for LDAP authentication.*
597+
598+
Hostname and port of an |ldap| server in the format
599+
``<hostname>:<port>``.
600+
601+
To specify multiple |ldap| servers, use a
602+
comma-separated list. For example, specify
603+
``"<hostname1>:<port1>,<hostname2>:<port2>"``.
604+
---
605+
program: _shared
606+
name: spec.security.authentication.ldap.transportSecurity
607+
type: string
608+
directive: setting
609+
description: |
610+
*Required for LDAP authentication.*
611+
612+
Specifies whether the |ldap| server accepts |tls|.
613+
614+
If the |ldap| server accepts |tls|, set to ``tls``. If the |ldap|
615+
server doesn't accept |tls|, leave this value blank.
616+
---
617+
program: _shared
618+
name: spec.security.authentication.ldap.caConfigMapRef
619+
type: collection
620+
directive: setting
621+
description: |
622+
*Required for LDAP authentication with TLS.*
623+
624+
|k8s-configmap| that contains a |certauth| which validates the |ldap|
625+
server's |tls| certificate.
626+
---
627+
program: _shared
628+
name: spec.security.authentication.ldap.caConfigMapRef.name
629+
type: string
630+
directive: setting
631+
description: |
632+
*Required for LDAP authentication with TLS.*
633+
634+
Name of the |k8s-configmap| that contains a |certauth| which validates
635+
the |ldap| server's |tls| certificate.
636+
---
637+
program: _shared
638+
name: spec.security.authentication.ldap.caConfigMapRef.key
639+
type: string
640+
directive: setting
641+
description: |
642+
*Required for LDAP authentication with TLS.*
643+
644+
Field name that stores the |certauth| which validates the |ldap|
645+
server's |tls| certificate.
646+
---
647+
program: _shared
648+
name: spec.security.authentication.ldap.bindQueryUser
649+
type: string
650+
directive: setting
651+
description: |
652+
*Required for LDAP authentication.*
653+
654+
|ldap| Distinguished Name to which MongoDB binds when connecting to
655+
the |ldap| server.
656+
---
657+
program: _shared
658+
name: spec.security.authentication.ldap.bindQueryPasswordSecretRef
659+
type: collection
660+
directive: setting
661+
description: |
662+
*Required for LDAP authentication.*
663+
664+
Specifies the |k8s-secret| that contains the password with which
665+
MongoDB binds when connecting to the |ldap| server.
666+
---
667+
program: _shared
668+
name: spec.security.authentication.ldap.bindQueryPasswordSecretRef.name
669+
type: string
670+
directive: setting
671+
description: |
672+
*Required for LDAP authentication.*
673+
674+
Name of the |k8s-secret| that contains the password with which MongoDB
675+
binds when connecting to the |ldap| server.
676+
677+
The |k8s-secret| must contain only one ``password`` field which stores
678+
the password.
679+
---
680+
program: _shared
577681
name: spec.additionalMongodConfig.net.ssl.mode
578682
type: string
579683
directive: setting

source/reference/k8s-operator-specification.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,26 @@ The following settings only apply to sharded cluster resource types:
196196
Security Settings
197197
-----------------
198198

199-
The following |tls| settings only apply to replica set and sharded
199+
The following security settings only apply to replica set and sharded
200200
cluster resource types:
201201

202202
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.enabled.rst
203203
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.ca.rst
204+
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.additionalCertificateDomains.rst
204205
.. include:: /includes/option/setting-k8sRsConf-spec.additionalMongodConfig.net.ssl.mode.rst
205206
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.rst
206207
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.enabled.rst
207208
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.modes.rst
208209
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.internalCluster.rst
209-
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.additionalCertificateDomains.rst
210+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.rst
211+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.servers.rst
212+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.transportSecurity.rst
213+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.caConfigMapRef.rst
214+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.caConfigMapRef.name.rst
215+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.caConfigMapRef.key.rst
216+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.bindQueryUser.rst
217+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.bindQueryPasswordSecretRef.rst
218+
.. include:: /includes/option/setting-k8sRsConf-spec.security.authentication.ldap.bindQueryPasswordSecretRef.name.rst
210219

211220
Examples
212221
--------

0 commit comments

Comments
 (0)