1
1
ref : x509-certificate-client
2
2
content : |
3
3
4
- Client certificates must have the following properties :
4
+ Client certificate requirements :
5
5
6
6
- A single Certificate Authority (CA) must issue the certificates
7
7
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
8
16
9
17
- Client certificates must contain the following fields:
10
18
@@ -13,44 +21,55 @@ content: |
13
21
keyUsage = digitalSignature
14
22
extendedKeyUsage = clientAuth
15
23
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.
17
52
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.
38
53
39
- - The x.509 certificate must *not* be expired.
40
54
41
- .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst
42
55
---
43
56
ref : x509-certificate-member
44
57
content : |
45
58
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 :
50
63
51
- - A single Certificate Authority (CA) must issue all the x.509
64
+ - A single Certificate Authority (CA) must issue all x.509
52
65
certificates for the members of a sharded cluster or a replica set.
53
66
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
+
54
73
- The Distinguished Name (``DN``), found in the member certificate's
55
74
``subject``, must specify a non-empty value for *at least one* of
56
75
the following attributes:
@@ -59,44 +78,37 @@ content: |
59
78
- the Organizational Unit (``OU``)
60
79
- the Domain Component (``DC``)
61
80
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.
68
86
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.
76
89
77
90
.. code-block:: none
78
91
79
92
CN=host1,OU=Dept1,O=MongoDB,ST=NY,C=US
80
93
C=US, ST=CA, O=MongoDB, OU=Dept1, CN=host2
81
94
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.
85
98
86
99
.. code-block:: none
87
100
88
101
CN=host1,OU=Dept1,OU=Sales,O=MongoDB
89
102
CN=host2,OU=Dept1,O=MongoDB
90
103
91
104
- 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.
97
109
98
110
For example, the certificates for a cluster could have the
99
- following subjects :
111
+ following ``subject``\s :
100
112
101
113
.. code-block:: bash
102
114
@@ -112,9 +124,7 @@ content: |
112
124
113
125
extendedKeyUsage = clientAuth
114
126
115
- - The x.509 certificate must *not* be expired.
116
127
117
- .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst
118
128
---
119
129
ref : x509-member-auth-configuration
120
130
content : |
@@ -133,17 +143,15 @@ content: |
133
143
<mongod --clusterAuthMode>` (*available starting in MongoDB 4.2*)
134
144
135
145
: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
138
148
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
142
151
:option:`--tlsCertificateKeyFile <mongod --tlsCertificateKeyFile>`
143
152
(*available starting in MongoDB 4.2*).
144
153
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
147
155
membership authentication, the certificate must either:
148
156
149
157
- Omit ``extendedKeyUsage`` or
0 commit comments