Skip to content

Commit 1eb751d

Browse files
committed
DOCS-11689: x509 and invalid Certificates
1 parent befd244 commit 1eb751d

13 files changed

+144
-122
lines changed

source/includes/extracts-mongo-ssl-options-base.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

source/includes/extracts-mongo-ssl-options.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
ref: ssl-facts-x509-invalid-certificate
2+
content: |
3+
4+
Starting in MongoDB 3.2.21, if you specify
5+
``--sslAllowInvalidCertificates`` or ``ssl.allowInvalidCertificates:
6+
true`` when using x.509 authentication, an invalid certificate is
7+
only sufficient to establish a TLS/SSL connection but is
8+
*insufficient* for authentication.
9+
---
10+
ref: ssl-facts-x509-ca-file
11+
content: |
12+
13+
If using x.509 authentication, ``--sslCAFile`` or ``ssl.CAFile``
14+
must be specified.
15+
---
16+
ref: ssl-facts-see-more
17+
content: |
18+
For more information about TLS/SSL and MongoDB, see
19+
:doc:`/tutorial/configure-ssl` and
20+
:doc:`/tutorial/configure-ssl-clients` .
21+
---
22+
# This is separate from the mongod/mongos ca file extract since the version is different.
23+
ref: ssl-facts-mongo-shell-ca
24+
content: |
25+
26+
Starting in version 3.2.6, if ``--sslCAFile`` or ``ssl.CAFile`` is
27+
not specified, the system-wide CA certificate store will be used
28+
when connecting to an TLS/SSL-enabled server. In previous versions
29+
of MongoDB, the :binary:`~bin.mongo` shell exited with an error that
30+
it could not validate the certificate.
31+
32+
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
33+
---
34+
ref: ssl-facts-invalid-cert-warning-clients
35+
content: |
36+
37+
.. warning::
38+
39+
For TLS/SSL connections to :binary:`~bin.mongod` and
40+
:binary:`~bin.mongos`, avoid using
41+
``--sslAllowInvalidCertificates`` if possible and only use
42+
``--sslAllowInvalidCertificates`` on systems where intrusion is
43+
not possible.
44+
45+
If the :binary:`~bin.mongo` shell (and other
46+
:ref:`mongodb-tools-support-ssl`) runs with the
47+
``--sslAllowInvalidCertificates`` option, the
48+
:binary:`~bin.mongo` shell (and other
49+
:ref:`mongodb-tools-support-ssl`) will not attempt to validate
50+
the server certificates. This creates a vulnerability to expired
51+
:binary:`~bin.mongod` and :binary:`~bin.mongos` certificates as
52+
well as to foreign processes posing as valid
53+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instances.
54+
55+
---
56+
ref: ssl-facts-mongo-ssl-options-configure
57+
content: |
58+
59+
To connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that
60+
uses TLS/SSL, you must also specify the ``--host`` option for the
61+
:binary:`~bin.mongo` shell if you haven't specified a connect
62+
string. The :binary:`~bin.mongo` shell verifies that the hostname of
63+
the :binary:`~bin.mongod` or :binary:`~bin.mongos` matches the CN or
64+
SAN of ``--sslPEMKeyFile`` certificate presented by the
65+
:binary:`~bin.mongod` or :binary:`~bin.mongos`. If the hostname does
66+
not match the CN/SAN, :binary:`~bin.mongo` will fail to connect.
67+
68+
...

source/includes/fact-ssl-supported.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

source/includes/options-conf.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ directive: setting
686686
replacement:
687687
program: ":binary:`~bin.mongos` or :binary:`~bin.mongod`"
688688
verb: "Enable or disable"
689+
setting: "``allowInvalidCertificates: true``"
689690
inherit:
690691
name: sslAllowInvalidCertificates
691692
program: mongod
@@ -1568,7 +1569,7 @@ description: |
15681569
MongoDB instances if the hostname their certificates do not match the
15691570
specified hostname.
15701571
1571-
.. include:: /includes/fact-ssl-supported.rst
1572+
.. include:: /includes/extracts/ssl-facts-see-more.rst
15721573
15731574
replacement:
15741575
program: ":binary:`~bin.mongod`"

source/includes/options-mongo.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,14 @@ args: null
213213
directive: option
214214
description: |
215215
216+
.. versionchanged:: 3.2.6
217+
216218
Enables connection to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that has
217219
TLS/SSL support enabled.
218220
219-
.. include:: /includes/extracts/mongo-ssl-options-mongo.rst
221+
.. include:: /includes/extracts/ssl-facts-mongo-shell-ca.rst
220222
221-
.. include:: /includes/fact-ssl-supported.rst
223+
.. include:: /includes/extracts/ssl-facts-see-more.rst
222224
optional: true
223225
---
224226
program: mongo
@@ -236,7 +238,7 @@ description: |
236238
:setting:`~net.ssl.CAFile` enabled *without*
237239
:setting:`~net.ssl.allowConnectionsWithoutCertificates`.
238240
239-
.. include:: /includes/fact-ssl-supported.rst
241+
.. include:: /includes/extracts/ssl-facts-see-more.rst
240242
optional: true
241243
---
242244
program: mongo
@@ -254,7 +256,7 @@ description: |
254256
specify the {{role}} option, the {{program}} will prompt for a
255257
passphrase. See :ref:`ssl-certificate-password`.
256258
257-
.. include:: /includes/fact-ssl-supported.rst
259+
.. include:: /includes/extracts/ssl-facts-see-more.rst
258260
optional: true
259261
---
260262
program: mongo
@@ -266,11 +268,9 @@ description: |
266268
from the Certificate Authority. Specify the file name of the
267269
:file:`.pem` file using relative or absolute paths.
268270
269-
.. include:: /includes/extracts/mongo-ssl-options-mongo.rst
270-
271-
.. include:: /includes/extracts/mongo-warning-sslCAFile.rst
271+
.. include:: /includes/extracts/ssl-facts-mongo-shell-ca.rst
272272
273-
.. include:: /includes/fact-ssl-supported.rst
273+
.. include:: /includes/extracts/ssl-facts-see-more.rst
274274
275275
optional: true
276276
---
@@ -284,7 +284,7 @@ description: |
284284
List. Specify the file name of the :file:`.pem` file using relative or
285285
absolute paths.
286286
287-
.. include:: /includes/fact-ssl-supported.rst
287+
.. include:: /includes/extracts/ssl-facts-see-more.rst
288288
optional: true
289289
---
290290
program: mongo
@@ -302,15 +302,18 @@ directive: option
302302
description: |
303303
304304
Bypasses the validation checks for server certificates and allows
305-
the use of invalid certificates. When using the
306-
:setting:`~net.ssl.allowInvalidCertificates` setting, MongoDB logs as a
307-
warning the use of the invalid certificate.
305+
the use of invalid certificates to connect.
306+
307+
.. note::
308+
309+
.. include:: /includes/extracts/ssl-facts-x509-invalid-certificate.rst
308310
309-
.. include:: /includes/extracts/mongo-ssl-options-mongo.rst
311+
.. include:: /includes/extracts/ssl-facts-invalid-cert-warning-clients.rst
310312
311-
.. include:: /includes/extracts/mongo-warning-sslCAFile.rst
313+
When using the :setting:`~net.ssl.allowInvalidCertificates` setting,
314+
MongoDB logs as a warning the use of the invalid certificate.
312315
313-
.. include:: /includes/fact-ssl-supported.rst
316+
.. include:: /includes/extracts/ssl-facts-see-more.rst
314317
optional: true
315318
---
316319
program: mongo

source/includes/options-mongod.yaml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,9 @@ description: |
598598
- Recommended. Send the x.509 certificate for authentication and
599599
accept only x.509 certificates.
600600
601-
.. include:: /includes/fact-ssl-supported.rst
601+
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
602+
603+
.. include:: /includes/extracts/ssl-facts-see-more.rst
602604
optional: true
603605
---
604606
program: mongod
@@ -1208,7 +1210,7 @@ description: |
12081210
{{option}}. By default, {{role}} is
12091211
disabled.
12101212
1211-
.. include:: /includes/fact-ssl-supported.rst
1213+
.. include:: /includes/extracts/ssl-facts-see-more.rst
12121214
optional: true
12131215
replacement:
12141216
verb: "Enables"
@@ -1251,7 +1253,9 @@ description: |
12511253
12521254
- The server uses and accepts only TLS/SSL encrypted connections.
12531255
1254-
.. include:: /includes/fact-ssl-supported.rst
1256+
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
1257+
1258+
.. include:: /includes/extracts/ssl-facts-see-more.rst
12551259
12561260
optional: true
12571261
replacement:
@@ -1269,7 +1273,7 @@ description: |
12691273
12701274
You must specify {{role}} when TLS/SSL is enabled.
12711275
1272-
.. include:: /includes/fact-ssl-supported.rst
1276+
.. include:: /includes/extracts/ssl-facts-see-more.rst
12731277
optional: true
12741278
replacement:
12751279
intro: "Specifies the"
@@ -1289,7 +1293,7 @@ description: |
12891293
specify the {{role}} option, the {{program}} will prompt for a
12901294
passphrase. See :ref:`ssl-certificate-password`.
12911295
1292-
.. include:: /includes/fact-ssl-supported.rst
1296+
.. include:: /includes/extracts/ssl-facts-see-more.rst
12931297
optional: true
12941298
replacement:
12951299
intro: "Specifies the"
@@ -1310,7 +1314,9 @@ description: |
13101314
authentication, the cluster uses the ``.pem`` file specified in the
13111315
{{pemKeyOption}} {{directive}}.
13121316
1313-
.. include:: /includes/fact-ssl-supported.rst
1317+
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
1318+
1319+
.. include:: /includes/extracts/ssl-facts-see-more.rst
13141320
optional: true
13151321
replacement:
13161322
pemKeyOption: ":option:`--sslPEMKeyFile`"
@@ -1333,7 +1339,7 @@ description: |
13331339
{{role}} option, the {{program}} will prompt for a passphrase. See
13341340
:ref:`ssl-certificate-password`.
13351341
1336-
.. include:: /includes/fact-ssl-supported.rst
1342+
.. include:: /includes/extracts/ssl-facts-see-more.rst
13371343
optional: true
13381344
replacement:
13391345
intro: "Specifies the"
@@ -1348,9 +1354,9 @@ description: |
13481354
from the Certificate Authority. Specify the file name of the
13491355
:file:`.pem` file using relative or absolute paths.
13501356
1351-
.. include:: /includes/fact-ssl-supported.rst
1357+
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
1358+
.. include:: /includes/extracts/ssl-facts-see-more.rst
13521359
1353-
.. include:: /includes/warning-x509-requires-sslCAfile.rst
13541360
optional: true
13551361
replacement:
13561362
intro: "Specifies the"
@@ -1365,7 +1371,7 @@ description: |
13651371
List. Specify the file name of the :file:`.pem` file using relative or
13661372
absolute paths.
13671373
1368-
.. include:: /includes/fact-ssl-supported.rst
1374+
.. include:: /includes/extracts/ssl-facts-see-more.rst
13691375
optional: true
13701376
replacement:
13711377
intro: "Specifies the"
@@ -1376,14 +1382,19 @@ args: null
13761382
directive: option
13771383
description: |
13781384
1379-
{{verb}} the validation checks for TLS/SSL certificates on other servers
1380-
in the cluster and allows the use of invalid certificates.
1385+
{{verb}} the validation checks for TLS/SSL certificates on other
1386+
servers in the cluster and allows the use of invalid certificates to
1387+
connect.
1388+
1389+
.. note::
1390+
1391+
.. include:: /includes/extracts/ssl-facts-x509-invalid-certificate.rst
13811392
13821393
When using
13831394
the {{role}} setting, MongoDB
13841395
logs a warning regarding the use of the invalid certificate.
13851396
1386-
.. include:: /includes/fact-ssl-supported.rst
1397+
.. include:: /includes/extracts/ssl-facts-see-more.rst
13871398
optional: true
13881399
replacement:
13891400
verb: "Bypasses"
@@ -1406,7 +1417,7 @@ description: |
14061417
Use the {{role}} option if you have a mixed deployment that includes
14071418
clients that do not or cannot present certificates to the {{program}}.
14081419
1409-
.. include:: /includes/fact-ssl-supported.rst
1420+
.. include:: /includes/extracts/ssl-facts-see-more.rst
14101421
replacement:
14111422
verb: "Disables"
14121423
old_name: "``--sslWeakCertificateValidation``"
@@ -1426,7 +1437,7 @@ description: |
14261437
to other members if the hostnames in their certificates do not match
14271438
their configured hostname.
14281439
1429-
.. include:: /includes/fact-ssl-supported.rst
1440+
.. include:: /includes/extracts/ssl-facts-see-more.rst
14301441
optional: true
14311442
---
14321443
program: mongod

0 commit comments

Comments
 (0)