Skip to content

Commit 6dd5d10

Browse files
skerschbkay-kim
authored andcommitted
DOCS-11426: Windows and Mac secure store
1 parent c04ea3e commit 6dd5d10

14 files changed

+170
-2
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The following selectors are available.
2+
3+
.. list-table::
4+
:header-rows: 1
5+
:widths: auto
6+
7+
* - property name
8+
- value type
9+
- value description
10+
11+
* - subject
12+
- ASCII string
13+
- subject name or common name on certificate
14+
* - thumbprint
15+
- hex string
16+
- certificate thumbprint
17+
18+
.. note::
19+
20+
The term ``thumbprint`` refers to what is also frequently
21+
referred to as a ``fingerprint``. It is a short sequence of bytes used
22+
to identify a longer public key.

source/includes/options-mongo.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ description: |
241241
optional: true
242242
---
243243
program: mongo
244+
name: sslCertificateSelector
245+
inherit:
246+
name: sslCertificateSelector
247+
program: mongod
248+
file: options-mongod.yaml
249+
---
250+
program: mongo
244251
name: sslPEMKeyFile
245252
args: <filename>
246253
directive: option

source/includes/options-mongod.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,25 @@ description: |
12051205
optional: false
12061206
---
12071207
program: mongod
1208+
name: sslCertificateSelector
1209+
args: <parameter>=<value>
1210+
directive: option
1211+
description: |
1212+
1213+
.. versionadded:: 4.0
1214+
1215+
Specifies the selector and value to search when using Windows or
1216+
Mac system certificate store mechanisms.
1217+
1218+
This option must be followed by a key value pair indicated by
1219+
<parameter>=<value>. In this case parameter is the name of the
1220+
selector.
1221+
1222+
.. include:: /includes/option-ssl-certificateSelector.rst
1223+
1224+
optional: true
1225+
---
1226+
program: mongod
12081227
name: sslOnNormalPorts
12091228
args: null
12101229
directive: option

source/includes/options-mongos.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ inherit:
259259
file: options-shared.yaml
260260
---
261261
program: mongos
262+
name: sslCertificateSelector
263+
inherit:
264+
name: sslCertificateSelector
265+
program: mongod
266+
file: options-mongod.yaml
267+
---
268+
program: mongos
262269
name: sslMode
263270
inherit:
264271
name: sslMode

source/includes/ssl-trusted-store.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
MacOS and Windows both offer system certificate stores that can be
2+
accessed across applications via OS specific APIs. Starting in MongoDB
3+
version 4.0, certificates can be retrieved from these stores by
4+
searching for them via certain well-defined selectors that are available
5+
in all certificates.
6+
7+
On the command line you can pass the :option:`--sslCertificateSelector
8+
<mongod --sslCertificateSelector>` followed by the certificate selector
9+
you would like to use and the value of that selector.
10+
11+
.. include:: /includes/option-ssl-certificateSelector.rst
12+
13+
Use the selectors by passing <parameter>=<value> on the
14+
command line. For example, for a certificate with the common name or
15+
subject ``my.dev.server``, you would use:
16+
17+
18+

source/reference/configuration-options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ Core Options
264264
filePermissions: <int>
265265
ssl:
266266
sslOnNormalPorts: <boolean> # deprecated since 2.6
267+
certificateSelector: <string>
267268
mode: <string>
268269
PEMKeyFile: <string>
269270
PEMKeyPassword: <string>

source/reference/parameters.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,22 @@ Authentication Parameters
294294
- :method:`db.createUser()`
295295
- :method:`db.updateUser()`
296296

297+
.. parameter:: sslCertificateSelector
298+
299+
.. versionadded:: 4.0
300+
301+
Specifies the ``selector`` and value to search when using Windows or
302+
Mac Secure Transport mechanisms for certificate store.
303+
304+
When passed as a parameter on the command line, this option must be
305+
followed by a key value pair indicated by <parameter>=<value>.
306+
307+
In a config file use the :setting:`net.ssl.certificateSelector` followed
308+
by the parameter/value pair.
309+
310+
.. include:: /includes/option-ssl-certificateSelector.rst
311+
312+
297313
.. parameter:: sslMode
298314

299315
.. versionadded:: 2.6

source/reference/program/mongo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ TLS/SSL Options
119119

120120
.. include:: /includes/option/option-mongo-sslCAFile.rst
121121

122+
.. include:: /includes/option/option-mongo-sslCertificateSelector.rst
123+
122124
.. include:: /includes/option/option-mongo-sslCRLFile.rst
123125

124126
.. include:: /includes/option/option-mongo-sslFIPSMode.rst

source/reference/program/mongod.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ TLS/SSL Options
261261

262262
.. include:: /includes/option/option-mongod-sslClusterFile.rst
263263

264+
.. include:: /includes/option/option-mongod-sslCertificateSelector.rst
265+
264266
.. include:: /includes/option/option-mongod-sslClusterPassword.rst
265267

266268
.. include:: /includes/option/option-mongod-sslCAFile.rst

source/reference/program/mongos.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ TLS/SSL Options
129129

130130
.. include:: /includes/option/option-mongos-sslCAFile.rst
131131

132+
.. include:: /includes/option/option-mongos-sslCertificateSelector.rst
133+
132134
.. include:: /includes/option/option-mongos-sslCRLFile.rst
133135

134136
.. include:: /includes/option/option-mongos-sslAllowConnectionsWithoutCertificates.rst

source/release-notes/4.0.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,16 @@ CA, specify that CA using :setting:`net.ssl.CAFile`.
433433

434434
.. _4.0-deprecate-mmapv1:
435435

436+
Enable System Store for SSL on Windows and Mac
437+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
438+
439+
The :option:`--sslCertificateSelector <mongo --sslCertificateSelector>` option
440+
(:setting:`net.ssl.certificateSelector` setting) allows
441+
:binary:`~bin.mongod`, :binary:`~bin.mongo` shell and
442+
:binary:`~bin.mongos` to use system ssl certificate stores for Windows
443+
and Mac.
444+
445+
436446
Deprecate MMAPv1
437447
----------------
438448

source/tutorial/configure-ssl-clients.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,36 @@ settings, including:
5353

5454
.. include:: /includes/extracts/ssl-facts-mongo-ssl-options-configure.rst
5555

56+
.. versionadded:: 4.0
57+
58+
- :option:`--sslCertificateSelector <mongo --sslCertificateSelector>` option if you
59+
wish to use the system store for clients running on Mac or Windows.
60+
61+
.. include:: /includes/extracts/mongo-ssl-options-configure.rst
62+
63+
.. include:: /includes/extracts/clients-warning-sslCAFile.rst
64+
5665
For a complete list of the :binary:`~bin.mongo` shell's TLS/SSL settings, see
5766
:ref:`mongo-shell-ssl`.
5867

68+
Using System Stores for Storing Keys and Certificates for Mac and Windows
69+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70+
71+
.. include:: /includes/ssl-trusted-store.rst
72+
73+
.. code-block:: sh
74+
75+
mongo --ssl --sslCertificateSelector subject=my.dev.server
76+
77+
Alternatively, use the :setting:`~net.ssl.certificateSelector` to
78+
configure the certificate storage selector with a config file.
79+
80+
.. code-block:: yaml
81+
82+
net:
83+
ssl:
84+
certificateSelector: <parameter>=<value>
85+
5986
Connect to MongoDB Instance Using Encryption
6087
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6188

source/tutorial/configure-ssl.txt

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,45 @@ in the following example:
106106
format, various conversion tools exist, such as ``openssl pkcs8``
107107
and others.
108108

109+
109110
Procedures
110111
----------
111112

113+
.. versionadded:: 4.0
114+
115+
Using System Stores for Storing Keys and Certificates for Mac and Windows
116+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117+
118+
.. include:: /includes/ssl-trusted-store.rst
119+
120+
.. code-block:: sh
121+
122+
mongod --sslMode requireSSL --sslCertificateSelector subject=my.dev.server
123+
124+
Alternatively, use the :setting:`~net.ssl.certificateSelector` to
125+
configure the certificate storage selector with a config file.
126+
127+
.. code-block:: yaml
128+
129+
net:
130+
ssl:
131+
certificateSelector: <parameter>=<value>
132+
133+
134+
.. tip::
135+
136+
If you are using :option:`--sslCertificateSelector <mongod --sslCertificateSelector>` or
137+
:setting:`~net.ssl.certificateSelector`, the :option:`--sslPEMKeyFile
138+
<mongod --sslPEMKeyFile>` is invalid. OCSP (Online Certificate Status Protocol) is
139+
used to validate the revocation status of certificates.
140+
112141
.. note::
113142

114143
.. include:: /includes/extracts/default-bind-ip-security.rst
115144

116145
.. _ssl-mongod-ssl-cert-key:
117146

147+
118148
Set Up ``mongod`` and ``mongos`` with TLS/SSL Certificate and Key
119149
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120150

@@ -244,12 +274,10 @@ See :ref:`ssl-clients` for more information on connecting to
244274

245275
Block Revoked Certificates for Clients
246276
``````````````````````````````````````
247-
248277
To prevent clients with revoked certificates from connecting, include
249278
the :setting:`sslCRLFile` to specify a :file:`.pem` file that contains
250279
revoked certificates.
251280

252-
253281
For example, the following :binary:`~bin.mongod` with TLS/SSL configuration
254282
includes the :setting:`sslCRLFile` setting:
255283

source/tutorial/upgrade-cluster-to-ssl.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ process:
6161
PEMKeyFile: <path to TLS/SSL certificate and key PEM file>
6262
CAFile: <path to root CA PEM file>
6363

64+
.. note::
65+
66+
If you are using :option:`--sslCertificateSelector <mongod --sslCertificateSelector>`
67+
or :setting:`~net.ssl.certificateSelector`, the :option:`--sslPEMKeyFile <mongod --sslPEMKeyFile>`
68+
option is invalid. See :doc:`instructions </tutorial/configure-ssl>` on how to configure
69+
TLS/SSL with ``certificateSelector``.
70+
6471

6572
#. Switch all clients to use TLS/SSL. See :ref:`ssl-clients`.
6673

0 commit comments

Comments
 (0)