11ref : x509-certificate-client
22content : |
33
4- Client certificates must have the following properties :
4+ Client certificate requirements :
55
66 - A single Certificate Authority (CA) must issue the certificates
77 for both the client and the server.
8+
9+ - Each unique MongoDB user must have a unique certificate.
10+
11+ - The x.509 certificate must *not* be expired.
12+
13+ .. note::
14+
15+ .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst
816
917 - Client certificates must contain the following fields:
1018
@@ -13,44 +21,55 @@ content: |
1321 keyUsage = digitalSignature
1422 extendedKeyUsage = clientAuth
1523
16- - Each unique MongoDB user must have a unique certificate.
24+ - At least one of the following client certificate attributes must be **different**
25+ than the attributes in both the :setting:`net.tls.clusterFile` and
26+ :setting:`net.tls.certificateKeyFile` server certificates:
27+
28+ - Organization (``O``)
29+ - Organizational Unit (``OU``)
30+ - Domain Component (``DC``)
31+
32+ - The ``subject`` of a client x.509 certificate, which contains the
33+ Distinguished Name (``DN``), must be **different** than the ``subject``\s
34+ of :ref:`member x.509 certificates <x509-member-certificate>`.
35+
36+ .. important::
37+
38+ If a client x.509 certificate's subject matches the ``O``, ``OU``, and
39+ ``DC`` attributes of the :ref:`x509-member-certificate` (or
40+ :parameter:`tlsX509ClusterAuthDNOverride`, if set) exactly, the client
41+ connection is accepted, full permissions are granted, and a warning
42+ message appears in the log.
43+
44+ Only :ref:`cluster member x509 certificates <x509-member-certificate>`
45+ should use the same ``O``, ``OU``, and ``DC`` attribute combinations.
46+
47+
48+ .. versionadded:: 4.2
49+
50+ If the MongoDB deployment has :parameter:`tlsX509ClusterAuthDNOverride`
51+ set, the client x.509 certificate's subject must not match that value.
1752
18- - A client x.509 certificate's subject, which contains the
19- Distinguished Name (``DN``), must **differ** from the subjects of
20- :ref:`member x.509 certificates <x509-member-certificate>`.
21-
22- At least one of the Organization (``O``), Organizational Unit
23- (``OU``), or Domain Component (``DC``) attributes in the client
24- certificate must differ from those in the
25- :setting:`net.tls.clusterFile` and
26- :setting:`net.tls.certificateKeyFile` server certificates. If a
27- client x.509 certificate's subject has the same ``O``, ``OU``, and
28- ``DC`` combination as the :ref:`x509-member-certificate` (or
29- :parameter:`tlsX509ClusterAuthDNOverride` if set), the client
30- connection is rejected. Only :ref:`cluster member x509 certificates
31- <x509-member-certificate>` should use same ``O``, ``OU``, and
32- ``DC`` combinations as this grants full permissions.
33-
34- If the MongoDB deployment has
35- :parameter:`tlsX509ClusterAuthDNOverride` set (*available starting
36- in MongoDB 4.2*), the client x.509 certificate's subject must also
37- differ from that value.
3853
39- - The x.509 certificate must *not* be expired.
4054
41- .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst
4255 ---
4356ref : x509-certificate-member
4457content : |
4558
46- Member certificates which you use to verify membership to a sharded
47- cluster or a replica set (:setting:`net.tls.clusterFile`, if
48- specified, and :setting:`net.tls.certificateKeyFile`), must have the
49- following properties :
59+ Use member certificates to verify membership to a sharded
60+ cluster or a replica set. Member certificates are stored in
61+ :setting:`net.tls.clusterFile` and :setting:`net.tls.certificateKeyFile`.
62+ Member certificate requirements :
5063
51- - A single Certificate Authority (CA) must issue all the x.509
64+ - A single Certificate Authority (CA) must issue all x.509
5265 certificates for the members of a sharded cluster or a replica set.
5366
67+ - The x.509 certificate must *not* be expired.
68+
69+ .. note::
70+
71+ .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst
72+
5473 - The Distinguished Name (``DN``), found in the member certificate's
5574 ``subject``, must specify a non-empty value for *at least one* of
5675 the following attributes:
@@ -59,44 +78,37 @@ content: |
5978 - the Organizational Unit (``OU``)
6079 - the Domain Component (``DC``)
6180
62- - The Organization attributes (``O``\'s), the Organizational Unit
63- attributes (``OU``\'s), and the Domain Components (``DC``\'s) must
64- match those from both the :setting:`net.tls.clusterFile` and
65- :setting:`net.tls.certificateKeyFile` certificates for the other
66- cluster members (or the :parameter:`tlsX509ClusterAuthDNOverride`
67- value, if set).
81+ - Each cluster member certificate must have identical ``O``\s, ``OU``\s,
82+ and ``DC``\s in their :setting:`net.tls.clusterFile` and
83+ :setting:`net.tls.certificateKeyFile` certificates. This also applies to
84+ the :parameter:`tlsX509ClusterAuthDNOverride` value, if set. Attribute
85+ order doesn't matter.
6886
69- To match, the certificate must match all specifications of these
70- attributes, even the non-specification of these attributes. The
71- order of the attributes does not matter.
72-
73- In the following example, the two ``DN``\'s contain matching
74- specifications for ``O``, ``OU`` as well as the non-specification
75- of the ``DC`` attribute.
87+ Here's an example. The two ``DN``\s below have matching
88+ specifications for ``O`` and ``OU``, and ``DC`` is not specified.
7689
7790 .. code-block:: none
7891
7992 CN=host1,OU=Dept1,O=MongoDB,ST=NY,C=US
8093 C=US, ST=CA, O=MongoDB, OU=Dept1, CN=host2
8194
82- However, the following two ``DN``\'s contain a mismatch for the
83- ``OU `` attribute since one contains two ``OU`` specifications and
84- the other, only one specification.
95+ The following example is incorrect, because the ``DN``\s don't match. One
96+ ``DN `` has two ``OU`` specifications and the other has only one ``OU``
97+ specification.
8598
8699 .. code-block:: none
87100
88101 CN=host1,OU=Dept1,OU=Sales,O=MongoDB
89102 CN=host2,OU=Dept1,O=MongoDB
90103
91104 - Either the Common Name (``CN``) or one of the Subject Alternative
92- Name (``SAN``) entries must match the hostname of the server, used
93- by the other members of the cluster. Starting in MongoDB 4.2, when
94- performing comparison of SAN, MongoDB supports comparison of DNS
95- names or IP addresses. In previous versions, MongoDB only supports
96- comparisons of DNS names.
105+ Name (``SAN``) entries must match the server hostname for other cluster
106+ members. Starting in MongoDB 4.2, when comparing ``SAN``\s, MongoDB can
107+ compare either DNS names or IP addresses. In previous versions, MongoDB
108+ only compares DNS names.
97109
98110 For example, the certificates for a cluster could have the
99- following subjects :
111+ following ``subject``\s :
100112
101113 .. code-block:: bash
102114
@@ -112,9 +124,7 @@ content: |
112124
113125 extendedKeyUsage = clientAuth
114126
115- - The x.509 certificate must *not* be expired.
116127
117- .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst
118128 ---
119129ref : x509-member-auth-configuration
120130content : |
@@ -133,17 +143,15 @@ content: |
133143 <mongod --clusterAuthMode>` (*available starting in MongoDB 4.2*)
134144
135145 :binary:`~bin.mongod` and :option:`mongos <mongos
136- --tlsCertificateKeyFile>` instances use their certificate key file to
137- prove their identity to clients, but it can also be used for
146+ --tlsCertificateKeyFile>` instances use their certificate key files to
147+ prove their identity to clients, but certificate key files can also be used for
138148 membership authentication. If you do not specify a cluster file,
139- members use their certificate key file for membership authentication.
140- The certificate key file is the file you specify with
141- :setting:`net.tls.certificateKeyFile` or
149+ members use their certificate key files for membership authentication.
150+ Specify the certificate key file with :setting:`net.tls.certificateKeyFile` or
142151 :option:`--tlsCertificateKeyFile <mongod --tlsCertificateKeyFile>`
143152 (*available starting in MongoDB 4.2*).
144153
145- To use the :setting:`certificate key file
146- <net.tls.certificateKeyFile>` for both client authentication and
154+ To use the certificate key file for both client authentication and
147155 membership authentication, the certificate must either:
148156
149157 - Omit ``extendedKeyUsage`` or
0 commit comments