Skip to content

Commit f147887

Browse files
committed
DOCS-14293, DOCS-14294 add FLE support shell GCP Azure
1 parent 7636e96 commit f147887

27 files changed

+1629
-427
lines changed

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

Lines changed: 98 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -51,27 +53,25 @@ The :binary:`~bin.mongo` shell supports two methods for configuring
5153
access to an AWS KMS:
5254

5355
- Use the client-side field level encryption :ref:`command-line options
54-
<mongo-client-side-field-level-encryption-options>`,
55-
56-
*or*
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

7066
- ``kms:Encrypt``
7167
`(reference)
7268
<https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html>`__
7369

74-
.. admonition:: 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>`__
73+
74+
.. admonition:: Implement Principle of Least Privilege for KMS Access
7575
:class: note
7676

7777
Consider configuring IAM user roles such that MongoDB has only the
@@ -97,8 +97,90 @@ key *must* have at least one policy with the following actions:
9797
]
9898
}
9999

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

103185
.. _field-level-encryption-local-kms:
104186

@@ -111,7 +193,8 @@ be a 96-byte long string.
111193

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

116199
.. _field-level-encryption-keyvault:
117200

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)