Skip to content

[Encryption] Add autoEncryption configuration to the client #889

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

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented May 26, 2025

Introduce the configuration of the autoEncryption driver option in order to support automatic Client Side Field Level Encryption.

This requires a MongoDB Atlas or Entreprise cluster.

@GromNaN GromNaN force-pushed the fix-kms-xsd-docs-alignment branch 3 times, most recently from 9d2e2ba to 60cc9c2 Compare May 27, 2025 12:35
@GromNaN GromNaN force-pushed the fix-kms-xsd-docs-alignment branch 3 times, most recently from 1f7c5cd to d7472e8 Compare June 14, 2025 07:31
@GromNaN GromNaN force-pushed the fix-kms-xsd-docs-alignment branch from 2bf901b to 751082b Compare June 17, 2025 13:54
@GromNaN GromNaN changed the base branch from 5.4.x to feature/queryable-encryption June 17, 2025 13:54
@GromNaN GromNaN force-pushed the fix-kms-xsd-docs-alignment branch from 751082b to 46d9784 Compare June 17, 2025 13:55
@GromNaN GromNaN requested a review from alcaeus June 17, 2025 13:55
@GromNaN GromNaN marked this pull request as ready for review June 17, 2025 13:55
@GromNaN
Copy link
Member Author

GromNaN commented Jun 17, 2025

This is not complete as we don't inject the kmsProvider name and masterKey into the ODM configuration, which is necessary for the schema tools.

docs/config.rst Outdated
bypassAutoEncryption: false # Disables auto-encryption
keyVaultClient: null # Service ID of a MongoDB\Driver\Manager for the key vault
keyVaultNamespace: null # The namespace for the key vault collection (e.g., "encryption.__keyVault")
kmsProviders: [] # Configuration for Key Management System providers (see specific examples above)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be kmsProvider since we're only accepting a single provider at this time.

docs/config.rst Outdated
'bypassAutoEncryption' => false, // Disables auto-encryption
'keyVaultClient' => null, // Service ID of a MongoDB\Driver\Manager for the key vault
'keyVaultNamespace' => null, // The namespace for the key vault collection (e.g., "encryption.__keyVault")
'kmsProviders' => [ // Configuration for Key Management System providers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single KMS provider here as well

Comment on lines 30 to 32
kmsProviders:
local:
key: "YOUR_BASE64_KEY"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kmsProvider

Comment on lines 45 to 49
'kmsProviders' => [
'local' => [
'key' => 'YOUR_BASE64_KEY',
],
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kmsProvider

]);
};

Supported KMS Providers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to duplicate the full list here? If so, we may want to properly explain the individual options required for each KMS provider and where to obtain them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the duplicated list and added a link to https://www.php.net/manual/en/mongodb-driver-manager.construct.php

Queryable Encryption (QE)
-------------------------

Queryable Encryption (QE) allows you to run queries on encrypted fields. To use QE, you may need to provide an ``encryptedFieldsMap`` or use a schema map, depending on your driver and use case.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can adapt this to mention the dump command I'm working on

@GromNaN GromNaN changed the title Add autoEncryption configuration to the client [Encryption] Add autoEncryption configuration to the client Jun 17, 2025
@GromNaN GromNaN merged commit bd5212a into doctrine:feature/queryable-encryption Jun 17, 2025
1 check passed
@GromNaN GromNaN mentioned this pull request Jun 17, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants