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

source/includes/steps-deploy-k8s-replica-set-tls-custom.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ source:
1212
ref: create-rs-tls-secret
1313
---
1414
stepnum: 3
15+
ref: create-k8s-rs-agent-secret
16+
source:
17+
file: steps-source-deploy-k8s-resource.yaml
18+
ref: create-agent-tls-secret
19+
---
20+
stepnum: 4
1521
ref: create-k8s-rs-tls-configmap
1622
source:
1723
file: steps-source-deploy-k8s-resource.yaml
1824
ref: create-rs-tls-configmap
1925

2026
---
21-
stepnum: 4
27+
stepnum: 5
2228
ref: copy-k8s-example-rs-tls
2329
source:
2430
file: steps-source-deploy-k8s-resource.yaml
@@ -45,31 +51,31 @@ replacement:
4551
:emphasize-lines: 1-7
4652
4753
---
48-
stepnum: 5
54+
stepnum: 6
4955
ref: paste-k8s-example-rs-tls
5056
source:
5157
file: steps-source-deploy-k8s-resource.yaml
5258
ref: paste-k8s-example-resource-section
5359
replacement:
5460
k8sResource: :term:`replica set`
5561
---
56-
stepnum: 6
62+
stepnum: 7
5763
ref: k8s-add-rs-tls
5864
source:
5965
file: steps-source-deploy-k8s-resource.yaml
6066
ref: add-tls-settings-custom-ca
6167
replacement:
6268
k8sResource: :term:`replica set`
6369
---
64-
stepnum: 7
70+
stepnum: 8
6571
ref: save-object-spec-rs-tls
6672
source:
6773
file: steps-source-deploy-k8s-resource.yaml
6874
ref: save-object-spec-update
6975
replacement:
7076
k8sResource: :term:`replica set`
7177
---
72-
stepnum: 8
78+
stepnum: 9
7379
ref: start-k8s-deployment-rs-tls
7480
source:
7581
file: steps-source-deploy-k8s-resource.yaml
@@ -78,7 +84,7 @@ replacement:
7884
k8sResource: :term:`replica set`
7985
k8sResourceType: replica-set
8086
---
81-
stepnum: 9
87+
stepnum: 10
8288
title: "Track the status of your deployment."
8389
level: 4
8490
ref: track-k8s-deployment-basic-rs-tls

source/includes/steps-deploy-k8s-replica-set-x509-custom.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ source:
1212
ref: create-rs-tls-secret
1313
---
1414
stepnum: 3
15+
ref: create-k8s-rs-agent-secret
16+
source:
17+
file: steps-source-deploy-k8s-resource.yaml
18+
ref: create-agent-tls-secret
19+
---
20+
stepnum: 4
1521
ref: create-k8s-rs-tls-configmap
1622
source:
1723
file: steps-source-deploy-k8s-resource.yaml
1824
ref: create-rs-tls-configmap
1925
---
20-
stepnum: 4
26+
stepnum: 5
2127
ref: copy-k8s-example-rs-x509
2228
source:
2329
file: steps-source-deploy-k8s-resource.yaml
@@ -44,39 +50,39 @@ replacement:
4450
:emphasize-lines: 1-10
4551
4652
---
47-
stepnum: 5
53+
stepnum: 6
4854
ref: paste-k8s-example-rs-x509
4955
source:
5056
file: steps-source-deploy-k8s-resource.yaml
5157
ref: paste-k8s-example-resource-section
5258
replacement:
5359
k8sResource: :term:`replica set`
5460
---
55-
stepnum: 6
61+
stepnum: 7
5662
ref: k8s-add-rs-tls
5763
source:
5864
file: steps-source-deploy-k8s-resource.yaml
5965
ref: add-tls-settings-custom-ca
6066
replacement:
6167
k8sResource: :term:`replica set`
6268
---
63-
stepnum: 7
69+
stepnum: 8
6470
ref: k8s-add-rs-x509
6571
source:
6672
file: steps-source-deploy-k8s-resource.yaml
6773
ref: add-client-x509-settings
6874
replacement:
6975
k8sResource: :term:`replica set`
7076
---
71-
stepnum: 8
77+
stepnum: 9
7278
ref: save-object-spec-rs-x509
7379
source:
7480
file: steps-source-deploy-k8s-resource.yaml
7581
ref: save-object-spec-update
7682
replacement:
7783
k8sResource: :term:`replica set`
7884
---
79-
stepnum: 9
85+
stepnum: 10
8086
ref: start-k8s-deployment-rs-x509
8187
source:
8288
file: steps-source-deploy-k8s-resource.yaml
@@ -86,7 +92,7 @@ replacement:
8692
k8sResourceType: replica-set
8793
---
8894
title: "Track the status of your deployment."
89-
stepnum: 10
95+
stepnum: 11
9096
level: 4
9197
ref: track-k8s-deployment-rs-x509
9298
content: |

0 commit comments

Comments
 (0)