Skip to content

include rationale for CSFLE cmds to mongocryptd on unencrypted colls #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions source/client-side-encryption/client-side-encryption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,30 @@ JSON schema data is only needed for automatic encryption but not for automatic
decryption. ``listCollections`` is not run when ``bypassAutoEncryption`` is
``true``, making a metadataClient unnecessary.

Why are commands sent to mongocryptd on collections without encrypted fields?
-----------------------------------------------------------------------------

If a ``MongoClient`` is configured with automatic encryption, all commands on
collections listed as ``AUTOENCRYPT`` in `libmongocrypt: Auto Encryption
Allow-List`_ undergo the automatic encryption process. Even if the collection
does not have an associated schema, the command is sent to mongocryptd as a
safeguard. A collection may not have encrypted fields, but a command on the
collection may could have sensitive data as part of the command arguments. For
example:

.. code::

db.publicData.aggregate([
{$lookup: {from: "privateData", localField: "_id", foreignField: "_id", as: "privateData"}},
{$match: {"privateData.ssn": "123-45-6789"}},
])


The ``publicData`` collection does not have encrypted fields, but the
``privateData`` collection does. mongocryptd rejects an aggregate with
``$lookup`` since there is no mechanism to determine encrypted fields of joined
collections.

Future work
===========

Expand Down