Skip to content

Commit 77564be

Browse files
committed
Merge branch 'v4.4.5'
2 parents b9f9bb8 + e58b017 commit 77564be

29 files changed

+1761
-472
lines changed

source/core/security-client-side-encryption-key-management.txt

Lines changed: 112 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Supported Key Management Services
1919

2020
Client-side field level encryption requires a Key Management Service
2121
(KMS) for accessing a Customer Master Key (CMK). MongoDB automatically
22-
encrypts data encryption keys using the specified CMK during
23-
:doc:`data encryption key creation
24-
</reference/method/KeyVault.createKey>`.
22+
encrypts data encryption keys using the specified CMK during
23+
:doc:`data encryption key creation
24+
</reference/method/KeyVault.createKey>`.
2525

2626
Deleting the CMK renders all data encryption keys encrypted with that
2727
CMK as permanently unreadable, which in turn renders all values
@@ -30,7 +30,9 @@ encrypted with those data encryption keys as permanently unreadable.
3030
Client-side field level encryption supports the following KMS providers:
3131

3232
- :ref:`Amazon Web Services KMS <field-level-encryption-aws-kms>`
33-
- :ref:`Locally Managed Keyfile <field-level-encryption-local-kms>`
33+
- :ref:`Azure Key Vault <field-level-encryption-azure-keyvault>`
34+
- :ref:`Google Cloud Platform KMS <field-level-encryption-gcp-kms>`
35+
- :ref:`Locally Managed Key <field-level-encryption-local-kms>`
3436

3537
.. _field-level-encryption-aws-kms:
3638

@@ -39,43 +41,40 @@ Amazon Web Services KMS
3941

4042
.. include:: /includes/extracts/csfle-aws-kms-4.2.0-4.2.1-broken.rst
4143

42-
MongoDB client-side encryption supports using the
43-
`Amazon Web Services Key Management Service
44+
MongoDB client-side encryption supports using the
45+
`Amazon Web Services Key Management Service
4446
<https://aws.amazon.com/kms>`__ for encrypting
4547
and decrypting data encryption keys. Specifically, MongoDB securely
4648
transmits the data encryption key to AWS KMS for encrypting or
4749
decrypting using the specified Customer Master Key (CMK). The CMK never
48-
leaves the AWS KMS.
50+
leaves the AWS KMS.
4951

50-
The :binary:`~bin.mongo` shell supports two methods for configuring
52+
The :binary:`~bin.mongo` shell supports two methods for configuring
5153
access to an AWS KMS:
5254

53-
- Use the client-side field level encryption :ref:`command-line options
54-
<mongo-client-side-field-level-encryption-options>`,
55-
56-
*or*
55+
- Use the client-side field level encryption :ref:`command-line options
56+
<mongo-client-side-field-level-encryption-options>`, or
5757

5858
- Use the :method:`Mongo()` constructor to create a database connection
5959
with the required AWS :ref:`KMS configuration options
6060
<ClientSideFieldLevelEncryptionOptions>`.
6161

62-
Configuring access to an AWS KMS requires at minimum an AWS access key
63-
and its corresponding secret key. The IAM user associated to the access
64-
key *must* have at least one policy with the following actions:
65-
66-
- ``kms:Decrypt``
67-
`(reference)
68-
<https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html>`__
62+
Configuring access to an AWS KMS requires at minimum an AWS Access Key
63+
and its corresponding Secret Key. The IAM User associated to the Access
64+
Key must have at least one policy with the following actions:
6965

70-
- ``kms:Encrypt``
71-
`(reference)
72-
<https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html>`__
66+
- ``kms:Encrypt``
67+
`(reference)
68+
<https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html>`__
7369

74-
.. note:: Implement Seperation of Least Privilege for KMS Access
70+
- ``kms:Decrypt``
71+
`(reference)
72+
<https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html>`__
7573

74+
.. note:: Implement Principle of Least Privilege for KMS Access
7675

77-
Consider configuring IAM user roles such that MongoDB has only the
78-
access to the actions and resources required to function.
76+
Consider configuring IAM user roles such that MongoDB has only the
77+
access to the actions and resources required to function.
7978

8079
For example, the following policy JSON scopes the required actions to
8180
a single CMK:
@@ -97,8 +96,90 @@ key *must* have at least one policy with the following actions:
9796
]
9897
}
9998

100-
For complete documentation on data encryption key management using AWS KMS, see
101-
:doc:`/tutorial/manage-client-side-encryption-data-keys`.
99+
For complete documentation on data encryption key management using AWS
100+
KMS, see :doc:`/tutorial/manage-client-side-encryption-data-keys` and
101+
select the "Amazon Web Services KMS" tab.
102+
103+
.. _field-level-encryption-azure-keyvault:
104+
105+
Azure Key Vault
106+
~~~~~~~~~~~~~~~
107+
108+
.. versionadded:: 4.4.5
109+
110+
MongoDB client-side encryption supports using the
111+
`Azure Key Vault Key Management Service
112+
<https://docs.microsoft.com/en-us/azure/key-vault/>`__ for encrypting
113+
and decrypting data encryption keys. Specifically, MongoDB securely
114+
transmits the data encryption key to Azure Key Vault for encrypting or
115+
decrypting using the specified Customer Master Key (CMK). The CMK never
116+
leaves the Azure Key Vault.
117+
118+
The :binary:`~bin.mongo` shell supports specifying Azure Key Vault
119+
as a KMS using the :method:`Mongo()` constructor using the
120+
:ref:`KMS configuration options
121+
<ClientSideFieldLevelEncryptionOptions>`.
122+
123+
Configuring access to Azure Key Vault requires at minimum an Azure
124+
Tenant ID, Client ID, and Client Secret. The Tenant ID must have the
125+
ability to perform the following actions:
126+
127+
- ``wrap key``
128+
`(reference)
129+
<https://docs.microsoft.com/en-us/rest/api/keyvault/wrapkey/wrapkey>`__
130+
131+
- ``unwrap key``
132+
`(reference)
133+
<https://docs.microsoft.com/en-us/rest/api/keyvault/unwrapkey/unwrapkey>`__
134+
135+
.. note::
136+
137+
MongoDB does *not* support Azure's client certificate authentication
138+
(also known as TLS mutual authentication).
139+
140+
For complete documentation on data encryption key management using
141+
Azure Key Vault, see
142+
:doc:`/tutorial/manage-client-side-encryption-data-keys` and select the
143+
"Azure Key Vault" tab.
144+
145+
.. _field-level-encryption-gcp-kms:
146+
147+
Google Cloud Platform KMS
148+
~~~~~~~~~~~~~~~~~~~~~~~~~
149+
150+
.. versionadded:: 4.4.5
151+
152+
MongoDB client-side encryption supports using the
153+
`Google Cloud KMS <https://cloud.google.com/kms/docs/>`__ for encrypting
154+
and decrypting data encryption keys. Specifically, MongoDB securely
155+
transmits the data encryption key to Google Cloud KMS for encrypting or
156+
decrypting using the specified Customer Master Key (CMK). The CMK never
157+
leaves the Google Cloud KMS.
158+
159+
The :binary:`~bin.mongo` shell supports specifying Google Cloud KMS
160+
as a KMS using the :method:`Mongo()` constructor using the
161+
:ref:`KMS configuration options
162+
<ClientSideFieldLevelEncryptionOptions>`.
163+
164+
Configuring access to Google Cloud KMS requires at minimum a Google
165+
Cloud Email and associated Private Key. The Google Cloud Email account
166+
must have the following IAM permissions for the specified Private Key:
167+
168+
- ``cloudkms.cryptoKeyVersions.useToEncrypt``
169+
170+
- ``cloudkms.cryptoKeyVersions.useToDecrypt``
171+
172+
These IAM permissions are included in certain
173+
`Google Cloud predefined roles
174+
<https://cloud.google.com/kms/docs/reference/permissions-and-roles#predefined>`__
175+
or can be included in a
176+
`Google Cloud custom role
177+
<https://cloud.google.com/kms/docs/reference/permissions-and-roles#custom_roles>`__.
178+
179+
For complete documentation on data encryption key management using
180+
Google Cloud KMS, see
181+
:doc:`/tutorial/manage-client-side-encryption-data-keys` and select the
182+
"Google Cloud KMS" tab.
102183

103184
.. _field-level-encryption-local-kms:
104185

@@ -111,7 +192,8 @@ be a 96-byte long string.
111192

112193
For complete documentation on data encryption key management using a
113194
locally managed key, see
114-
:doc:`/tutorial/manage-client-side-encryption-data-keys`.
195+
:doc:`/tutorial/manage-client-side-encryption-data-keys` and select the
196+
"Local Keyfile" tab.
115197

116198
.. _field-level-encryption-keyvault:
117199

@@ -147,7 +229,7 @@ encryption key management:
147229
- :method:`KeyVault.deleteKey()`
148230

149231
.. important::
150-
232+
151233
Removing a data encryption key renders all fields encrypted
152234
using that data encryption key as permanently unreadable.
153235

@@ -201,4 +283,4 @@ For complete documentation on data encryption key management, see
201283
:titlesonly:
202284
:hidden:
203285

204-
/tutorial/manage-client-side-encryption-data-keys.txt
286+
/tutorial/manage-client-side-encryption-data-keys.txt

source/core/security-client-side-encryption.txt

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,21 @@ driver and each encryption component:
168168
and is only available with MongoDB Enterprise. ``mongocryptd`` does
169169
not perform cryptographic functions.
170170

171-
- The key vault is a MongoDB collection that stores all data encryption
172-
keys used to encrypt values. Data encryption keys are themselves
173-
encrypted using a Customer Master Key (CMK) prior to storage in the
174-
collection. The key vault may reside on a different MongoDB cluster
175-
than the one storing the encrypted data. See
176-
:ref:`field-level-encryption-keyvault` for more information.
177-
178-
- The Key Management System stores the Customer Master Key used to
179-
encrypt data encryption keys. See :ref:`field-level-encryption-kms`
180-
for more information.
171+
- The :ref:`Key Vault <field-level-encryption-keyvault>` is a MongoDB
172+
collection that stores all data encryption keys used to encrypt
173+
values. Data encryption keys are themselves encrypted using a Customer
174+
Master Key (CMK) prior to storage in the collection. The key vault may
175+
reside on a different MongoDB cluster than the one storing the
176+
encrypted data.
177+
178+
- The :ref:`Key Management Service (KMS) <field-level-encryption-kms>`
179+
stores the Customer Master Key (CMK) used to encrypt data encryption
180+
keys. MongoDB supports the following KMS providers:
181+
182+
- :ref:`Amazon Web Services KMS <field-level-encryption-aws-kms>`
183+
- :ref:`Azure Key Vault <field-level-encryption-azure-keyvault>`
184+
- :ref:`Google Cloud Platform KMS <field-level-encryption-gcp-kms>`
185+
- :ref:`Locally Managed Key <field-level-encryption-local-kms>`
181186

182187
- The MongoDB cluster which stores the encrypted data may also
183188
enforce client-side field level encryption. See
@@ -252,8 +257,9 @@ Automatic Field Decryption
252257
The :bsontype:`BinData <Binary>` blob metadata includes the data
253258
encryption key ``_id`` and encryption algorithm used to encrypt the
254259
binary data. The 4.2-compatible drivers and 4.2 :binary:`~bin.mongo`
255-
shell use this metadata to attempt automatic decryption ``BinData`` type
256-
6 values. The automatic decryption process works as follows:
260+
shell use this metadata to attempt automatic decryption of
261+
:bsontype:`BinData <Binary>` subtype 6 objects. The automatic
262+
decryption process works as follows:
257263

258264
1. Check the :bsontype:`BinData <Binary>` blob metadata for the
259265
data encryption key and encryption algorithm used to encrypt the
@@ -265,17 +271,22 @@ shell use this metadata to attempt automatic decryption ``BinData`` type
265271
the ``BinData`` blob.
266272

267273
#. Check the data encryption key metadata for the Customer Master Key
268-
used to encrypt the key material.
269-
270-
#. For the Amazon Web Services KMS, send the data encryption key to the
271-
KMS service for decryption. If the CMK does not exist *or* if the
272-
connection configuration does not grant access to the CMK,
273-
decryption fails and the driver returns the ``BinData`` blob.
274-
275-
For the Locally Managed Key, retrieve the local key and decrypt the
276-
data encryption key. If the local key specified in the database
277-
configuration was not used to encrypt the data encryption key,
278-
decryption fails and the driver returns the ``BinData`` blob.
274+
(CMK) used to encrypt the key material.
275+
276+
#. For the :ref:`Amazon Web Services KMS
277+
<field-level-encryption-aws-kms>`, :ref:`Azure Key Vault
278+
<field-level-encryption-azure-keyvault>`, or
279+
:ref:`Google Cloud Platform KMS <field-level-encryption-gcp-kms>`,
280+
send the data encryption key to the KMS provider for decryption. If
281+
the CMK does not exist *or* if the connection configuration does not
282+
grant access to the CMK, decryption fails and the driver returns the
283+
``BinData`` blob.
284+
285+
For the :ref:`Locally Managed Key
286+
<field-level-encryption-local-kms>`, retrieve the local key and
287+
decrypt the data encryption key. If the local key specified in the
288+
database configuration was not used to encrypt the data encryption
289+
key, decryption fails and the driver returns the ``BinData`` blob.
279290

280291
#. Decrypt the :bsontype:`BinData <Binary>` value using the decrypted
281292
data encryption key and appropriate algorithm.

source/includes/extracts-client-side-field-level-encryption.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ content: |
88
99
- Use the :method:`Mongo()` constructor from the :binary:`~bin.mongo`
1010
shell to establish a connection with the required client-side field
11-
level encryption options. The :method:`Mongo()` method supports both
12-
Amazon Web Services and Local Key Management Service (KMS) providers
13-
for Customer Master Key (CMK) management.
11+
level encryption options. The :method:`Mongo()` method supports the
12+
following Key Management Service (KMS) providers for Customer
13+
Master Key (CMK) management:
14+
15+
- :ref:`Amazon Web Services KMS <field-level-encryption-aws-kms>`
16+
- :ref:`Azure Key Vault <field-level-encryption-azure-keyvault>`
17+
- :ref:`Google Cloud Platform KMS <field-level-encryption-gcp-kms>`
18+
- :ref:`Locally Managed Key <field-level-encryption-local-kms>`
1419
1520
*or*
1621
17-
- Use the ``mongo`` shell :ref:`command line options
22+
- Use the :binary:`~bin.mongo` shell :ref:`command line options
1823
<mongo-client-side-field-level-encryption-options>` to establish a
1924
connection with the required options. The command line options only
20-
support the AWS KMS provider for CMK management.
25+
support the :ref:`Amazon Web Services KMS
26+
<field-level-encryption-aws-kms>` provider for CMK management.
2127
---
2228
ref: csfle-keyvault-unique-index
2329
content: |
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
If successful, :method:`~KeyVault.createKey()` returns the
2+
:abbr:`UUID (Universally unique identifier)` of the new data encryption
3+
key. The ``UUID`` is a BSON :bsontype:`Binary (BinData) <Binary>` object
4+
with subtype ``4`` that uniquely identifies the data encryption key.
5+
The ``UUID`` string is the hexadecimal representation of the
6+
underlying binary data.
7+
8+
If you are providing the data encryption key to an official 4.2+
9+
compatible driver in order to configure
10+
:ref:`automatic client-side field level encryption
11+
<field-level-encryption-json-schema>`, you must use the ``base64``
12+
representation of the ``UUID`` string.
13+
14+
You can run the following operation in the :binary:`~bin.mongo`
15+
shell to convert a ``UUID`` hexadecimal string to its ``base64``
16+
representation:
17+
18+
.. code-block:: javascript
19+
20+
UUID("b4b41b33-5c97-412e-a02b-743498346079").base64()
21+
22+
Supply the ``UUID`` of your own data encryption key to this command, as
23+
returned from :method:`~KeyVault.createKey()` above, or as described in
24+
:ref:`field-level-encryption-data-key-retrieve`.

0 commit comments

Comments
 (0)