Skip to content

Commit c945e53

Browse files
authored
include rationale for CSFLE cmds to mongocryptd on unencrypted colls (#956)
1 parent 4f9ca96 commit c945e53

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

source/client-side-encryption/client-side-encryption.rst

+24
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,30 @@ JSON schema data is only needed for automatic encryption but not for automatic
14481448
decryption. ``listCollections`` is not run when ``bypassAutoEncryption`` is
14491449
``true``, making a metadataClient unnecessary.
14501450
1451+
Why are commands sent to mongocryptd on collections without encrypted fields?
1452+
-----------------------------------------------------------------------------
1453+
1454+
If a ``MongoClient`` is configured with automatic encryption, all commands on
1455+
collections listed as ``AUTOENCRYPT`` in `libmongocrypt: Auto Encryption
1456+
Allow-List`_ undergo the automatic encryption process. Even if the collection
1457+
does not have an associated schema, the command is sent to mongocryptd as a
1458+
safeguard. A collection may not have encrypted fields, but a command on the
1459+
collection may could have sensitive data as part of the command arguments. For
1460+
example:
1461+
1462+
.. code::
1463+
1464+
db.publicData.aggregate([
1465+
{$lookup: {from: "privateData", localField: "_id", foreignField: "_id", as: "privateData"}},
1466+
{$match: {"privateData.ssn": "123-45-6789"}},
1467+
])
1468+
1469+
1470+
The ``publicData`` collection does not have encrypted fields, but the
1471+
``privateData`` collection does. mongocryptd rejects an aggregate with
1472+
``$lookup`` since there is no mechanism to determine encrypted fields of joined
1473+
collections.
1474+
14511475
Future work
14521476
===========
14531477

0 commit comments

Comments
 (0)