Skip to content

Commit 7454fcd

Browse files
authored
QuickStart and Tutorial for QE and CSFLE: Update the required permissions and move to an include (#5597) (#6054)
* Update required permissions and move to an include * Simplify the permissions include * fix typo and formatting * add note about convention and move most to include
1 parent 0d1f82c commit 7454fcd

File tree

6 files changed

+35
-86
lines changed

6 files changed

+35
-86
lines changed

source/core/queryable-encryption/quick-start.txt

Lines changed: 9 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,7 @@ Procedure
9090
.. tab::
9191
:tabid: shell
9292

93-
- **kmsProviderName** - The KMS you're using to store your {+cmk-long+}.
94-
Set this variable to ``"local"`` for this tutorial.
95-
- **uri** - Your MongoDB deployment connection URI. Set your connection
96-
URI in the ``MONGODB_URI`` environment variable or replace the value
97-
directly.
98-
- **keyVaultDatabaseName** - The database in MongoDB where your data
99-
encryption keys (DEKs) will be stored. Set this variable
100-
to ``"encryption"``.
101-
- **keyVaultCollectionName** - The collection in MongoDB where your DEKs
102-
will be stored. Set this variable to ``"__keyVault"``.
103-
- **keyVaultNamespace** - The namespace in MongoDB where your DEKs will
104-
be stored. Set this variable to the values of the ``keyVaultDatabaseName``
105-
and ``keyVaultCollectionName`` variables, separated by a period.
106-
- **encryptedDatabaseName** - The database in MongoDB where your encrypted
107-
data will be stored. Set this variable to ``"medicalRecords"``.
108-
- **encryptedCollectionName** - The collection in MongoDB where your encrypted
109-
data will be stored. Set this variable to ``"patients"``.
93+
.. include:: /includes/qe-tutorials/qe-quick-start.rst
11094

11195
You can declare these variables by using the following code:
11296

@@ -119,23 +103,7 @@ Procedure
119103
.. tab::
120104
:tabid: nodejs
121105

122-
- **kmsProviderName** - The KMS you're using to store your {+cmk-long+}.
123-
Set this variable to ``"local"`` for this tutorial.
124-
- **uri** - Your MongoDB deployment connection URI. Set your connection
125-
URI in the ``MONGODB_URI`` environment variable or replace the value
126-
directly.
127-
- **keyVaultDatabaseName** - The database in MongoDB where your data
128-
encryption keys (DEKs) will be stored. Set this variable
129-
to ``"encryption"``.
130-
- **keyVaultCollectionName** - The collection in MongoDB where your DEKs
131-
will be stored. Set this variable to ``"__keyVault"``.
132-
- **keyVaultNamespace** - The namespace in MongoDB where your DEKs will
133-
be stored. Set this variable to the values of the ``keyVaultDatabaseName``
134-
and ``keyVaultCollectionName`` variables, separated by a period.
135-
- **encryptedDatabaseName** - The database in MongoDB where your encrypted
136-
data will be stored. Set this variable to ``"medicalRecords"``.
137-
- **encryptedCollectionName** - The collection in MongoDB where your encrypted
138-
data will be stored. Set this variable to ``"patients"``.
106+
.. include:: /includes/qe-tutorials/qe-quick-start.rst
139107

140108
You can declare these variables by using the following code:
141109

@@ -157,7 +125,8 @@ Procedure
157125
encryption keys (DEKs) will be stored. Set this variable
158126
to ``"encryption"``.
159127
- **key_vault_collection_name** - The collection in MongoDB where your DEKs
160-
will be stored. Set this variable to ``"__keyVault"``.
128+
will be stored. Set this variable to ``"__keyVault"``, which is the
129+
convention to help prevent mistaking it for a user collection.
161130
- **key_vault_namespace** - The namespace in MongoDB where your DEKs will
162131
be stored. Set this variable to the values of the ``key_vault_database_name``
163132
and ``key_vault_collection_name`` variables, separated by a period.
@@ -177,23 +146,7 @@ Procedure
177146
.. tab::
178147
:tabid: java-sync
179148

180-
- **kmsProviderName** - The KMS you're using to store your {+cmk-long+}.
181-
Set this variable to ``"local"`` for this tutorial.
182-
- **uri** - Your MongoDB deployment connection URI. Set your connection
183-
URI in the ``MONGODB_URI`` environment variable or replace the value
184-
directly.
185-
- **keyVaultDatabaseName** - The database in MongoDB where your data
186-
encryption keys (DEKs) will be stored. Set this variable
187-
to ``"encryption"``.
188-
- **keyVaultCollectionName** - The collection in MongoDB where your DEKs
189-
will be stored. Set this variable to ``"__keyVault"``.
190-
- **keyVaultNamespace** - The namespace in MongoDB where your DEKs will
191-
be stored. Set this variable to the values of the ``keyVaultDatabaseName``
192-
and ``keyVaultCollectionName`` variables, separated by a period.
193-
- **encryptedDatabaseName** - The database in MongoDB where your encrypted
194-
data will be stored. Set this variable to ``"medicalRecords"``.
195-
- **encryptedCollectionName** - The collection in MongoDB where your encrypted
196-
data will be stored. Set this variable to ``"patients"``.
149+
.. include:: /includes/qe-tutorials/qe-quick-start.rst
197150

198151
You can declare these variables by using the following code:
199152

@@ -206,23 +159,7 @@ Procedure
206159
.. tab::
207160
:tabid: go
208161

209-
- **kmsProviderName** - The KMS you're using to store your {+cmk-long+}.
210-
Set this variable to ``"local"`` for this tutorial.
211-
- **uri** - Your MongoDB deployment connection URI. Set your connection
212-
URI in the ``MONGODB_URI`` environment variable or replace the value
213-
directly.
214-
- **keyVaultDatabaseName** - The database in MongoDB where your data
215-
encryption keys (DEKs) will be stored. Set this variable
216-
to ``"encryption"``.
217-
- **keyVaultCollectionName** - The collection in MongoDB where your DEKs
218-
will be stored. Set this variable to ``"__keyVault"``.
219-
- **keyVaultNamespace** - The namespace in MongoDB where your DEKs will
220-
be stored. Set this variable to the values of the ``keyVaultDatabaseName``
221-
and ``keyVaultCollectionName`` variables, separated by a period.
222-
- **encryptedDatabaseName** - The database in MongoDB where your encrypted
223-
data will be stored. Set this variable to ``"medicalRecords"``.
224-
- **encryptedCollectionName** - The collection in MongoDB where your encrypted
225-
data will be stored. Set this variable to ``"patients"``.
162+
.. include:: /includes/qe-tutorials/qe-quick-start.rst
226163

227164
You can declare these variables by using the following code:
228165

@@ -241,7 +178,8 @@ Procedure
241178
encryption keys (DEKs) will be stored. Set the value of ``keyVaultDatabaseName``
242179
to ``"encryption"``.
243180
- **keyVaultCollectionName** - The collection in MongoDB where your DEKs
244-
will be stored. Set the value of ``keyVaultCollectionName`` to ``"__keyVault"``.
181+
will be stored. Set this variable to ``"__keyVault"``, which is the
182+
convention to help prevent mistaking it for a user collection.
245183
- **keyVaultNamespace** - The namespace in MongoDB where your DEKs will
246184
be stored. Set ``keyVaultNamespace`` to a new ``CollectionNamespace`` object whose name
247185
is the values of the ``keyVaultDatabaseName`` and ``keyVaultCollectionName`` variables,
@@ -264,10 +202,7 @@ Procedure
264202

265203
.. important:: {+key-vault-long-title+} Namespace Permissions
266204

267-
The {+key-vault-long+} is in the ``encryption.__keyVault``
268-
namespace. Ensure that the database user your application uses to connect
269-
to MongoDB has :ref:`ReadWrite <manual-reference-role-read-write>`
270-
permissions on this namespace.
205+
.. include:: /includes/note-key-vault-permissions
271206

272207
.. include:: /includes/queryable-encryption/env-variables.rst
273208

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To complete this tutorial, the database user your application uses to connect to
2+
MongoDB must have :authrole:`dbAdmin` permissions on the following namespaces:
3+
4+
- ``encryption.__keyVault``
5+
- ``medicalRecords`` database
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- **kmsProviderName** - The KMS you're using to store your {+cmk-long+}.
2+
Set this variable to ``"local"`` for this tutorial.
3+
- **uri** - Your MongoDB deployment connection URI. Set your connection
4+
URI in the ``MONGODB_URI`` environment variable or replace the value
5+
directly.
6+
- **keyVaultDatabaseName** - The database in MongoDB where your data
7+
encryption keys (DEKs) will be stored. Set this variable
8+
to ``"encryption"``.
9+
- **keyVaultCollectionName** - The collection in MongoDB where your DEKs
10+
will be stored. Set this variable to ``"__keyVault"``, which is the convention
11+
to help prevent mistaking it for a user collection.
12+
- **keyVaultNamespace** - The namespace in MongoDB where your DEKs will
13+
be stored. Set this variable to the values of the ``keyVaultDatabaseName``
14+
and ``keyVaultCollectionName`` variables, separated by a period.
15+
- **encryptedDatabaseName** - The database in MongoDB where your encrypted
16+
data will be stored. Set this variable to ``"medicalRecords"``.
17+
- **encryptedCollectionName** - The collection in MongoDB where your encrypted
18+
data will be stored. Set this variable to ``"patients"``.

source/includes/queryable-encryption/quick-start/dek.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@
8080

8181
.. note:: {+key-vault-long-title+} Namespace Permissions
8282

83-
The {+key-vault-long+} is in the ``encryption.__keyVault``
84-
namespace. Ensure that the database user your application uses to connect
85-
to MongoDB has :ref:`ReadWrite <manual-reference-role-read-write>`
86-
permissions on this namespace.
83+
.. include:: /includes/note-key-vault-permissions
8784

8885
.. tabs-drivers::
8986

source/includes/queryable-encryption/tutorials/exp/dek.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@
7171

7272
.. note:: {+key-vault-long-title+} Namespace Permissions
7373

74-
The {+key-vault-long+} is in the ``encryption.__keyVault``
75-
namespace. Ensure that the database user your application uses to connect
76-
to MongoDB has :ref:`ReadWrite <manual-reference-role-read-write>`
77-
permissions on this namespace.
74+
.. include:: /includes/note-key-vault-permissions
7875

7976
.. tabs-drivers::
8077

source/includes/quick-start/dek.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@
6969

7070
.. note:: {+key-vault-long-title+} Namespace Permissions
7171

72-
The {+key-vault-long+} is in the ``encryption.__keyVault``
73-
namespace. Ensure that the database user your application uses to connect
74-
to MongoDB has :ref:`ReadWrite <manual-reference-role-read-write>`
75-
permissions on this namespace.
72+
.. include:: /includes/note-key-vault-permissions
7673

7774
.. tabs-drivers::
7875

0 commit comments

Comments
 (0)