Skip to content

Commit 3786eed

Browse files
(DOCSP-17997)(DOCSP-17751)(DOCSP-18205): fix x509 procedures (#720)
* (DOCSP-17997)(DOCSP-17751)(DOCSP-18205): fix x509 procedures * (DOCSP-17997)(DOCSP-17751)(DOCSP-18205): renew agent certs * Apply suggestions from code review Co-authored-by: Melissa Mahoney <[email protected]> * (DOCSP-17997)(DOCSP-17751)(DOCSP-18205): add k8s versions in client certs prereqs page * Update resource-keys-client-x509.rst * (DOCSP-17997): settings clean up Co-authored-by: Melissa Mahoney <[email protected]>
1 parent 83a943d commit 3786eed

24 files changed

+251
-125
lines changed

source/includes/list-tables/resource-keys-client-x509.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
| ``.authentication``
1313
| :setting:`.enabled<spec.security.authentication.enabled>`
1414
- boolean
15-
- Optional
16-
- If this value is ``true``, authentication is enabled on the
15+
- Required
16+
- Set this value to ``true`` to enable authentication on the
1717
MongoDB deployment.
1818

1919
- ``true``
@@ -23,7 +23,5 @@
2323
| :setting:`.modes<spec.security.authentication.modes>`
2424
- array
2525
- Conditional
26-
- If you enabled authentication, you must set an authentication
27-
mechanism. Accepted values are ``X509``.
28-
- ``X509``
29-
26+
- Set this value to ``["X509"]``.
27+
- ``["X509"]``

source/includes/list-tables/resource-keys-internal-x509.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
| ``.authentication``
1313
| :setting:`.internalCluster<spec.security.authentication.internalCluster>`
1414
- string
15-
- Conditional
16-
- If you enabled authentication, you can enable
15+
- Required
16+
- Use this setting to enable
1717
:manual:`X.509 internal cluster authentication </tutorial/configure-x509-member-authentication#x509-internal-authentication>`.
18-
Accepted values are ``X509``.
1918

2019
.. important::
2120

22-
Once internal cluster authentication is enabled, it can not
21+
Once internal cluster authentication is enabled, it can't
2322
be disabled.
2423

2524
- ``X509``
26-
27-

source/includes/list-tables/resource-keys-tls-custom-ca.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* - | ``spec.security``
1212
| :setting:`.tls.enabled<spec.security.tls.enabled>`
1313
- boolean
14-
- Optional
14+
- Required
1515
- If this value is ``true``, |tls| is enabled on the MongoDB
1616
deployment.
1717

@@ -22,9 +22,9 @@
2222
* - | ``spec.security``
2323
| :setting:`.tls.ca<spec.security.tls.ca>`
2424
- string
25-
- Optional
26-
- If you use a custom |certauth| and have created the
27-
|k8s-configmap| that stores it, add the ConfigMap's name.
25+
- Required
26+
- Add the |k8s-configmap|\'s name that stores the custom |certauth|
27+
that you used to sign your deployment's |tls| certificates.
2828
- ``<custom-ca>``
2929

3030
* - | ``spec.security``

source/includes/options-k8s-shared.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,8 @@ default: "``false``"
658658
description: |
659659
660660
Specifies whether the MongoDB host requires clients to connect using a
661-
|tls| certificate. If ``true``, you must:
662-
663-
- Specify a certificate for the {+mdbagent+} in
664-
:setting:`spec.security.authentication.agents.clientCertificateSecretRef.name`.
665-
- Set :setting:`spec.security.tls.enabled` to ``true``.
661+
|tls| certificate. Defaults to ``true`` if
662+
:setting:`spec.security.tls.enabled` is ``true``.
666663
667664
---
668665
program: _shared
@@ -1132,7 +1129,7 @@ optional: true
11321129
description: |
11331130
11341131
Specifies the |k8s-secret| that contains the {+mdbagent+}'s
1135-
|tls| certificate.
1132+
|tls| certificate. If omitted, defaults to ``agent-certs``.
11361133
11371134
This secret must contain the following keys, the
11381135
values of which are |tls| certificates that can be validated by the
@@ -1153,9 +1150,6 @@ description: |
11531150
--from-file=mms-monitoring-agent-pem=<monitoring-cert.pem> \
11541151
-n <namespace>
11551152
1156-
This setting is required if
1157-
:setting:`spec.security.authentication.requireClientTLSAuthentication` is ``true``.
1158-
11591153
---
11601154
program: _shared
11611155
name: spec.additionalMongodConfig.net.ssl.mode

source/includes/prereqs/custom-ca-prereqs-naming-conventions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. admonition:: About the example filenames
1+
.. note:: About the example filenames
22

33
- Name these files the exact names provided, substituting the
44
appropriate variables. If a filename doesn't match, deployment

source/includes/prereqs/custom-ca-prereqs-rs-tls-only.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,25 @@
1010
- ``ca-pem``
1111
* - Each member of your replica set
1212
- ``<metadata.name>-<X>-pem``
13+
* - Your project's Automation or MongoDB Agent
14+
- ``mms-automation-agent-pem``
15+
* - Your project's Backup Agent (if needed)
16+
- ``mms-backup-agent-pem``
17+
* - Your project's Monitoring Agent (if needed)
18+
- ``mms-monitoring-agent-pem``
19+
20+
For the Agent PEM files, ensure that:
21+
22+
- the Common Name in each |tls| certificate is not empty, and
23+
- the combined Organization and Organizational Unit in each |tls|
24+
certificate differs from the combined Organization and
25+
Organizational Unit in the |tls| certificates for your
26+
replica set members.
1327

1428
.. include:: /includes/prereqs/pem-file-description.rst
1529

1630
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst
1731

1832
.. note:: About the Domain Names in certificates
1933

20-
.. include:: /includes/prereqs/pem-file-domain-name.rst
34+
.. include:: /includes/prereqs/pem-file-domain-name.rst

source/includes/prereqs/custom-ca-prereqs-rs-tls-x509-internal.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,18 @@
1717
* - Your project's Monitoring Agent (if needed)
1818
- ``mms-monitoring-agent-pem``
1919

20+
For the Agent PEM files, ensure that:
21+
22+
- the Common Name in each |tls| certificate is not empty, and
23+
- the combined Organization and Organizational Unit in each |tls|
24+
certificate differs from the combined Organization and
25+
Organizational Unit in the |tls| certificates for your
26+
replica set members.
27+
2028
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst
29+
30+
.. include:: /includes/prereqs/pem-file-description.rst
31+
32+
.. note:: About the Domain Names in certificates
33+
34+
.. include:: /includes/prereqs/pem-file-domain-name.rst

source/includes/prereqs/custom-ca-prereqs-sc-tls-only.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,25 @@
1414
- ``<metadata.name>-config-<X>-pem``
1515
* - Each |mongos|
1616
- ``<metadata.name>-mongos-<X>-pem``
17+
* - Your project's Automation or MongoDB Agent
18+
- ``mms-automation-agent-pem``
19+
* - Your project's Backup Agent (if needed)
20+
- ``mms-backup-agent-pem``
21+
* - Your project's Monitoring Agent (if needed)
22+
- ``mms-monitoring-agent-pem``
23+
24+
For the Agent PEM files, ensure that:
25+
26+
- the Common Name in each |tls| certificate is not empty, and
27+
- the combined Organization and Organizational Unit in each |tls|
28+
certificate differs from the combined Organization and
29+
Organizational Unit in the |tls| certificates for your
30+
sharded cluster members, config server members, and each |mongos|.
31+
32+
.. include:: /includes/prereqs/pem-file-description.rst
1733

1834
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst
35+
36+
.. note:: About the Domain Names in certificates
37+
38+
.. include:: /includes/prereqs/pem-file-domain-name.rst

source/includes/prereqs/custom-ca-prereqs-sc-tls-x509-internal.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@
2121
* - Your project's Monitoring Agent (if needed)
2222
- ``mms-monitoring-agent-pem``
2323

24+
For the Agent PEM files, ensure that:
25+
26+
- the Common Name in each |tls| certificate is not empty, and
27+
- the combined Organization and Organizational Unit in each |tls|
28+
certificate differs from the combined Organization and
29+
Organizational Unit in the |tls| certificates for your
30+
sharded cluster members, config server members, and each |mongos|.
31+
32+
.. include:: /includes/prereqs/pem-file-description.rst
33+
2434
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst
35+
36+
.. note:: About the Domain Names in certificates
37+
38+
.. include:: /includes/prereqs/pem-file-domain-name.rst

source/includes/steps-connect-to-x509-deployment.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ content: |
2222
metadata:
2323
name: new-x509-user
2424
spec:
25-
username: "CN=my-x509-authenticated-user, OU=organizationalunit, O=organization"
25+
username: "CN=my-x509-authenticated-user,OU=organizationalunit,O=organization"
2626
db: "$external"
2727
mongodbResourceRef:
2828
name: '<name of the MongoDB resource>'
2929
roles:
3030
- db: "admin"
31-
name: "clusterAdmin"
31+
name: "readWriteAnyDatabase"
3232
3333
This ConfigMap ``.yaml`` file describes a ``MongoDBUser`` custom object. You
3434
can use these custom objects to create MongoDB users.
@@ -81,23 +81,23 @@ stepnum: 5
8181
ref: connect-with-x509-user
8282
content: |
8383
Once you have created your X.509 user, try to connect to the
84-
deployment using the mongo Shell:
84+
deployment using the MongoDB Shell (``mongosh``):
8585
8686
.. tabs::
8787
88-
.. tab:: MongoDB 4.2
88+
.. tab:: MongoDB 4.2 and later
8989
:tabid: mdb-4-2
9090
9191
.. code-block:: sh
9292
93-
mongo --host {host} --tls --tlsCAFile /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --tlsCertificateKeyFile x509-full.pem --authenticationMechanism MONGODB-X509 --authenticationDatabase '$external'
93+
mongosh --host {host} --port {port} --tls --tlsCAFile /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --tlsCertificateKeyFile x509-full.pem --authenticationMechanism MONGODB-X509 --authenticationDatabase '$external'
9494
95-
.. tab:: MongoDB 4.0 and Older
95+
.. tab:: MongoDB 4.0 and earlier
9696
:tabid: mdb-4-0-and-older
9797
9898
.. code-block:: sh
9999
100-
mongo --host {host} --ssl --sslCAFile /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --sslPEMKeyFile x509-full.pem --authenticationMechanism MONGODB-X509 --authenticationDatabase '$external'
100+
mongosh --host {host} --port {port} --ssl --sslCAFile /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --sslPEMKeyFile x509-full.pem --authenticationMechanism MONGODB-X509 --authenticationDatabase '$external'
101101
102102
.. note::
103103

0 commit comments

Comments
 (0)