SlideShare a Scribd company logo
Queryable Encryption in MongoDB
Presented by
Ranjith,
Database Reliability Engineer, Mydbops
Mydbops MyWebinar Edition 29
Nov 25th, 2023
About Me
Ranjith
❏ Interested in MongoDB Internals
❏ Performance Troubleshooting
❏ Blogger
Mydbops Services
Focus on MySQL, MongoDB, PostgreSQL, TiDB, Cassandra
Consulting
Services
Consulting
Services
Managed
Services
24*7
DBA Team
Targeted
Engagement
❏ Introduction
❏ Enhanced Security in MongoDB
❏ CSFLE (Client-Side-Field-Level-Encryption)
❏ Queryable Encryption
❏ Queryable Encryption Types
❏ Limitations
Agenda
❏ MongoDB Encryption: Ensures robust security, protecting data from unauthorized access.
❏ Confidentiality & Integrity: Maintains data confidentiality and integrity.
❏ Flexible Methods: Offers diverse encryption options, including CSFLE and Queryable Encryption.
Introduction
Enhanced Security in MongoDB
Life Cycle
Two types of Encryption Mechanisms:
❏ Automatic Encryption: Enables encrypted read and write operations without explicit code
(MongoDB Enterprise & MongoDB Atlas).
❏ Explicit Encryption: Empowers encrypted operations using the MongoDB driver's encryption
library, applicable across all formats.
CSFLE (Client-Side-Field-Level-Encryption)
❏ Data Encryption Keys (DEKs)
❏ Key Vault Collections
❏ Key Management System (KMS)
❏ libmongocrypt
Important Key Components of CSFLE Encryption
❏ Query Initiation
❏ Encrypted Fields Analysis
❏ DEK Retrieval
❏ DEK Decryption
❏ Data Retrieval
❏ Data Decryption
How CSFLE Works?
Next Up: Queryable Encryption
❏ Queryable Encryption use random encryption whereas CSFLE use deterministic encryption
❏ In deterministic encryption, the same plaintext value is always encrypted to the same ciphertext.
❏ Queryable Encryption produces different ciphertexts for the same plaintext each time it is
encrypted.
❏ It prevents attackers from easily identifying patterns based on frequency.
CSFLS vs Queryable Encryption
❏ Encrypts During Transmission: Queryable Encryption secures data in transit with randomized
encryption, allowing queries.
❏ Client ensures data is always transmitted in encrypted form, automatically encrypting and
decrypting sensitive information.
MongoDB Supports Two Types:
❏ Implicit Queryable Encryption - Available on MongoDB Enterprise & MongoDB ATLAS
❏ Explicit Queryable Encryption - Available on MongoDB Enterprise & MongoDB ATLAS & MongoDB
Community
Queryable Encryption
❏ Data Encryption Keys (DEKs)
❏ Key Vault Collections
❏ Cryptographic Tokens
❏ Cryptographic Tags
❏ Key Management System (KMS)
Important Key components of Queryable Encryption
❏ DEK Function: The Data Encryption Key (DEK) encrypts fields in MongoDB documents.
❏ Secure Storage: DEK is securely stored in a MongoDB collection known as the keyVault collection.
Key Vault Collections
❏ DEK Storage: MongoDB's Key Vault collection stores encrypted Data Encryption Key (DEK) documents.
❏ Document Composition: DEK documents within the Key Vault collection are BSON documents that
encapsulate Data Encryption Keys (DEKs).
Data Encryption Keys (DEK’s)
❏ Tokenized Encryption: Cryptographic tokens represent encrypted data, allowing
querying without decryption.
❏ Queryable Encryption Process: Upon data insertion with queryable encryption,
designated fields are encrypted and stored as cryptographic tokens (Ciphertext) in the
namespace.
Cryptographic Tokens
❏ Metadata for Encryption: Cryptographic tags provide key and algorithm details for encrypted fields.
❏ Query Management: Crucial for MongoDB server in handling encrypted data during queries.
❏ Stored Guidance: Stored alongside data, cryptographic tags enable the server to determine the
appropriate encryption key for querying or decrypting data.
Cryptographic Tags
Queryable Encryption is supported by the following Key Management System (KMS) providers:
❏ Amazon Web Services KMS
❏ Azure Key Vault
❏ Google Cloud Platform KMS
❏ Any KMIP Compliant Key Management System
❏ Local Key Provider
Key Management System (KMS)
❏ Explicit encryption is a method wherein you explicitly define the encryption and decryption processes
for fields in your document during each operation conducted on your database.
❏ Explicit encryption is available and supported in the following MongoDB products:
MongoDB Community Server
MongoDB Enterprise Advanced
MongoDB Atlas
Explicit Queryable Encryption
How Write Operations works in Explicit Queryable Encryption?
❏ Application submits query.
❏ MongoDB drivers analyze query.
❏ DEKs (unique to specific fields) use AES-CBC-256 encryption.
❏ Each DEK is unique and associated with a specific field in the document.
AES - Advanced Encryption Standard
CBC-256 - 256 bit Cipher Block Chaining
❏ AES-CBC-256 creates cryptographic token with tags.
How Write Operations works in Explicit Queryable Encryption?
❏ Cryptographic token encrypts data (AES-CBC-256 + IV for uniqueness).
❏ DEKs are safeguarded by encrypting with CMK.
❏ Driver sends query to MongoDB server with encrypted fields as ciphertext.
❏ Encrypted data (Token + Tags) stored in MongoDB server.
How Write Operations works in Queryable Encryption?
❏ Enable Queryable Encryption for a collection.
❏ MongoDB generates two metadata collections in the specified database.
❏ For example, we have enabled the Queryable Encryption for the patients collection MongoDB
will generate the metedata collections like below
enxcol_.patients.ecoc //metadata collection1
enxcol_.patients.esc //metadata collection2
Metadata Collections
The .ecoc collection functions as a repository for encryption context information, encompassing
cryptographic tokens, cryptographic tags, and associated metadata.
❏ Cryptographic Tokens: Encrypted representations of specific field values.
❏ Cryptographic Tags: Metadata linked to encrypted fields for decryption.
❏ Context Information: Details on DEK associations for each cryptographic token.
❏ Cache Optimization: Collection acts as a cache, enhancing query performance.
❏ Size Management: Compaction command needed if metadata collection exceeds 1 GB.
❏ Temporary Storage: .ecoc serves as temporary storage for cryptographic metadata essential in
query processing.
enxcol_.patients.ecoc //metadata collection1
❏ DEK Details: Intricate info on Data Encryption Keys (DEKs) with unique identifiers and metadata.
❏ Key Management: Specifies the Customer Master Key (CMK) for DEK protection.
❏ Algorithms: Stores comprehensive details on encryption algorithms and parameters.
❏ Key Rotation: Insights into policies and schedules for managing key rotation.
❏ Configuration: Houses essential settings and metadata for the encryption system.
enxcol_.patients.esc //metadata collection2
❏ Internally Managed Collections: MongoDB manages these collections for queryable encryption
operations.
❏ Critical Role: Essential for the efficient processing of queries involving encrypted data.
❏ Enhanced Security: Provide context and metadata for decryption, ensuring sensitive information remains
secure.
❏ Background Operations: Typically not directly accessed or modified by users, functioning behind the
scenes.
❏ Foundational Component: Integral part of MongoDB's queryable encryption infrastructure.
enxcol_.patients.esc //metadata collection2
How Read Operation Works in Queryable Encryption?
❏ Query Submission: Application submits a query; MongoDB drivers analyze it.
❏ DEK Encryption: DEKs use AES-CBC-256 to encrypt specific document fields.
❏ Key Protection: DEKs are protected by encrypting them with the CMK.
❏ Query Transmission: Driver sends the query to MongoDB server, representing encrypted fields
as ciphertext.
❏ Cryptographic Tags: MongoDB uses tags to fetch the cryptographic token with encrypted data.
❏ Decryption Process: Driver decrypts query results using its keys.
❏ Client Return: Decrypted data is returned to the client in plaintext.
How Read Operation Works in Queryable Encryption?
Explicit Queryable Encryption Demo
❏ Automatic Queryable Encryption
❏ Driver and libmongocrypt Collaboration
❏ Streamlined Approach
❏ Seamless Operations
❏ Ease of Use and Security
❏ Available in MongoDB Enterprise and Atlas
Implicit ( Automatic) Queryable Encryption
❏ Query Initiation
❏ Field Analysis
❏ DEK Retrieval
❏ DEK Decryption
❏ Data Reading
❏ Data Decryption
❏ User Interaction
How Automatic Queryable Encryption Works?
Implicit Queryable Encryption Demo
❏ Compatibility Note: Queryable Encryption is incompatible with MongoDB Atlas Search.
❏ Server Limitation: Not applicable for MongoDB standalone servers.
❏ Shard Key Restriction: Encrypted fields cannot be used as shard keys.
❏ Collection Renaming Restriction: Renaming collections with encrypted fields is not allowed.
❏ _id Field Exclusion: Encryption cannot be applied to the _id field.
❏ MongoDB 7.0 support only Equality searches
❏ Encryption collection backup not supported for restoration
For detailed information, you can refer to the
https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/limitations/#std-label
-qe-reference-encryption-limits
Limitations Of Queryable Encryption
➔ MongoDB Implicit Queryable Encryption
https://www.mydbops.com/blog/mongodb-queryable-encryption/
➔ MongoDB Explicit Queryable Encryption
https://www.mydbops.com/blog/mongodb-7-explicit-queryable-encryption/
➔ MongoDB General Queryable Encryption Video
https://www.youtube.com/watch?v=vTM_YlieLBE&t=863s
Queryable Encryption Related Blogs
Any Questions?
Thank You

More Related Content

PDF
Engineering an Encrypted Storage Engine
PDF
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
PDF
MongoDB Europe 2016 - Who’s Helping Themselves To Your Data? Demystifying Mon...
PDF
MongoDB .local London 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
PDF
MongoDB World 2019: New Encryption Capabilities in MongoDB 4.2: A Deep Dive i...
PDF
Achieving compliance With MongoDB Security
PPTX
KMS at Okta - Intermediate Level
PPTX
KeyD: Secure Key-Deduplication with Identity-Based Broadcast Encryption
Engineering an Encrypted Storage Engine
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB Europe 2016 - Who’s Helping Themselves To Your Data? Demystifying Mon...
MongoDB .local London 2019: New Encryption Capabilities in MongoDB 4.2: A Dee...
MongoDB World 2019: New Encryption Capabilities in MongoDB 4.2: A Deep Dive i...
Achieving compliance With MongoDB Security
KMS at Okta - Intermediate Level
KeyD: Secure Key-Deduplication with Identity-Based Broadcast Encryption

Similar to Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops (20)

PDF
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MySQL Data Encryption at Rest
PPTX
Transparent Data Encryption for SharePoint Content Databases
PPTX
Securing Your Enterprise Web Apps with MongoDB Enterprise
PDF
Sharing secret keys in Docker containers and K8s
PPTX
Kerberos
PPTX
Walking the Bifrost: An Operator's Guide to Heimdal & Kerberos on macOS
PPTX
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
PPTX
Relational cloud, A Database-as-a-Service for the Cloud
PDF
Mongodb
PDF
AWS Well Architected-Info Session WeCloudData
PDF
Knolx_ Sealed Secrets
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
PDF
Secrets Management and Delivery to Kubernetes Pods
PPTX
Percona Live 2021 - MongoDB Security Features
PPTX
Transparent Encryption in HDFS
DOCX
KeyD: Secure Key-Deduplication with Identity-Based Broadcast Encryption
PPT
Steve Jones - Encrypting Data
PPTX
Secure deduplicaton with efficient and reliable convergent
PPTX
SafeNet Enterprise Key and Crypto Management
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MySQL Data Encryption at Rest
Transparent Data Encryption for SharePoint Content Databases
Securing Your Enterprise Web Apps with MongoDB Enterprise
Sharing secret keys in Docker containers and K8s
Kerberos
Walking the Bifrost: An Operator's Guide to Heimdal & Kerberos on macOS
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Relational cloud, A Database-as-a-Service for the Cloud
Mongodb
AWS Well Architected-Info Session WeCloudData
Knolx_ Sealed Secrets
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
Secrets Management and Delivery to Kubernetes Pods
Percona Live 2021 - MongoDB Security Features
Transparent Encryption in HDFS
KeyD: Secure Key-Deduplication with Identity-Based Broadcast Encryption
Steve Jones - Encrypting Data
Secure deduplicaton with efficient and reliable convergent
SafeNet Enterprise Key and Crypto Management
Ad

More from Mydbops (20)

PDF
Scaling TiDB for Large-Scale Application
PDF
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
PDF
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
PDF
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
PDF
AWS Blue Green Deployment for Databases - Mydbops
PDF
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
PDF
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
PDF
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
PDF
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
PDF
Read/Write Splitting using MySQL Router - Mydbops Meetup16
PDF
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
PDF
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
PDF
Demystifying Real time Analytics with TiDB
PDF
Must Know Postgres Extension for DBA and Developer during Migration
PDF
Efficient MySQL Indexing and what's new in MySQL Explain
PDF
Scale your database traffic with Read & Write split using MySQL Router
PDF
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PDF
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
PDF
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
PDF
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Scaling TiDB for Large-Scale Application
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
AWS Blue Green Deployment for Databases - Mydbops
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Read/Write Splitting using MySQL Router - Mydbops Meetup16
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Demystifying Real time Analytics with TiDB
Must Know Postgres Extension for DBA and Developer during Migration
Efficient MySQL Indexing and what's new in MySQL Explain
Scale your database traffic with Read & Write split using MySQL Router
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Ad

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
KodekX | Application Modernization Development
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
Teaching material agriculture food technology
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Cloud computing and distributed systems.
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
KodekX | Application Modernization Development
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Teaching material agriculture food technology

Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops

  • 1. Queryable Encryption in MongoDB Presented by Ranjith, Database Reliability Engineer, Mydbops Mydbops MyWebinar Edition 29 Nov 25th, 2023
  • 2. About Me Ranjith ❏ Interested in MongoDB Internals ❏ Performance Troubleshooting ❏ Blogger
  • 3. Mydbops Services Focus on MySQL, MongoDB, PostgreSQL, TiDB, Cassandra Consulting Services Consulting Services Managed Services 24*7 DBA Team Targeted Engagement
  • 4. ❏ Introduction ❏ Enhanced Security in MongoDB ❏ CSFLE (Client-Side-Field-Level-Encryption) ❏ Queryable Encryption ❏ Queryable Encryption Types ❏ Limitations Agenda
  • 5. ❏ MongoDB Encryption: Ensures robust security, protecting data from unauthorized access. ❏ Confidentiality & Integrity: Maintains data confidentiality and integrity. ❏ Flexible Methods: Offers diverse encryption options, including CSFLE and Queryable Encryption. Introduction
  • 8. Two types of Encryption Mechanisms: ❏ Automatic Encryption: Enables encrypted read and write operations without explicit code (MongoDB Enterprise & MongoDB Atlas). ❏ Explicit Encryption: Empowers encrypted operations using the MongoDB driver's encryption library, applicable across all formats. CSFLE (Client-Side-Field-Level-Encryption)
  • 9. ❏ Data Encryption Keys (DEKs) ❏ Key Vault Collections ❏ Key Management System (KMS) ❏ libmongocrypt Important Key Components of CSFLE Encryption
  • 10. ❏ Query Initiation ❏ Encrypted Fields Analysis ❏ DEK Retrieval ❏ DEK Decryption ❏ Data Retrieval ❏ Data Decryption How CSFLE Works?
  • 11. Next Up: Queryable Encryption
  • 12. ❏ Queryable Encryption use random encryption whereas CSFLE use deterministic encryption ❏ In deterministic encryption, the same plaintext value is always encrypted to the same ciphertext. ❏ Queryable Encryption produces different ciphertexts for the same plaintext each time it is encrypted. ❏ It prevents attackers from easily identifying patterns based on frequency. CSFLS vs Queryable Encryption
  • 13. ❏ Encrypts During Transmission: Queryable Encryption secures data in transit with randomized encryption, allowing queries. ❏ Client ensures data is always transmitted in encrypted form, automatically encrypting and decrypting sensitive information. MongoDB Supports Two Types: ❏ Implicit Queryable Encryption - Available on MongoDB Enterprise & MongoDB ATLAS ❏ Explicit Queryable Encryption - Available on MongoDB Enterprise & MongoDB ATLAS & MongoDB Community Queryable Encryption
  • 14. ❏ Data Encryption Keys (DEKs) ❏ Key Vault Collections ❏ Cryptographic Tokens ❏ Cryptographic Tags ❏ Key Management System (KMS) Important Key components of Queryable Encryption
  • 15. ❏ DEK Function: The Data Encryption Key (DEK) encrypts fields in MongoDB documents. ❏ Secure Storage: DEK is securely stored in a MongoDB collection known as the keyVault collection. Key Vault Collections ❏ DEK Storage: MongoDB's Key Vault collection stores encrypted Data Encryption Key (DEK) documents. ❏ Document Composition: DEK documents within the Key Vault collection are BSON documents that encapsulate Data Encryption Keys (DEKs). Data Encryption Keys (DEK’s)
  • 16. ❏ Tokenized Encryption: Cryptographic tokens represent encrypted data, allowing querying without decryption. ❏ Queryable Encryption Process: Upon data insertion with queryable encryption, designated fields are encrypted and stored as cryptographic tokens (Ciphertext) in the namespace. Cryptographic Tokens
  • 17. ❏ Metadata for Encryption: Cryptographic tags provide key and algorithm details for encrypted fields. ❏ Query Management: Crucial for MongoDB server in handling encrypted data during queries. ❏ Stored Guidance: Stored alongside data, cryptographic tags enable the server to determine the appropriate encryption key for querying or decrypting data. Cryptographic Tags
  • 18. Queryable Encryption is supported by the following Key Management System (KMS) providers: ❏ Amazon Web Services KMS ❏ Azure Key Vault ❏ Google Cloud Platform KMS ❏ Any KMIP Compliant Key Management System ❏ Local Key Provider Key Management System (KMS)
  • 19. ❏ Explicit encryption is a method wherein you explicitly define the encryption and decryption processes for fields in your document during each operation conducted on your database. ❏ Explicit encryption is available and supported in the following MongoDB products: MongoDB Community Server MongoDB Enterprise Advanced MongoDB Atlas Explicit Queryable Encryption
  • 20. How Write Operations works in Explicit Queryable Encryption?
  • 21. ❏ Application submits query. ❏ MongoDB drivers analyze query. ❏ DEKs (unique to specific fields) use AES-CBC-256 encryption. ❏ Each DEK is unique and associated with a specific field in the document. AES - Advanced Encryption Standard CBC-256 - 256 bit Cipher Block Chaining ❏ AES-CBC-256 creates cryptographic token with tags. How Write Operations works in Explicit Queryable Encryption?
  • 22. ❏ Cryptographic token encrypts data (AES-CBC-256 + IV for uniqueness). ❏ DEKs are safeguarded by encrypting with CMK. ❏ Driver sends query to MongoDB server with encrypted fields as ciphertext. ❏ Encrypted data (Token + Tags) stored in MongoDB server. How Write Operations works in Queryable Encryption?
  • 23. ❏ Enable Queryable Encryption for a collection. ❏ MongoDB generates two metadata collections in the specified database. ❏ For example, we have enabled the Queryable Encryption for the patients collection MongoDB will generate the metedata collections like below enxcol_.patients.ecoc //metadata collection1 enxcol_.patients.esc //metadata collection2 Metadata Collections
  • 24. The .ecoc collection functions as a repository for encryption context information, encompassing cryptographic tokens, cryptographic tags, and associated metadata. ❏ Cryptographic Tokens: Encrypted representations of specific field values. ❏ Cryptographic Tags: Metadata linked to encrypted fields for decryption. ❏ Context Information: Details on DEK associations for each cryptographic token. ❏ Cache Optimization: Collection acts as a cache, enhancing query performance. ❏ Size Management: Compaction command needed if metadata collection exceeds 1 GB. ❏ Temporary Storage: .ecoc serves as temporary storage for cryptographic metadata essential in query processing. enxcol_.patients.ecoc //metadata collection1
  • 25. ❏ DEK Details: Intricate info on Data Encryption Keys (DEKs) with unique identifiers and metadata. ❏ Key Management: Specifies the Customer Master Key (CMK) for DEK protection. ❏ Algorithms: Stores comprehensive details on encryption algorithms and parameters. ❏ Key Rotation: Insights into policies and schedules for managing key rotation. ❏ Configuration: Houses essential settings and metadata for the encryption system. enxcol_.patients.esc //metadata collection2
  • 26. ❏ Internally Managed Collections: MongoDB manages these collections for queryable encryption operations. ❏ Critical Role: Essential for the efficient processing of queries involving encrypted data. ❏ Enhanced Security: Provide context and metadata for decryption, ensuring sensitive information remains secure. ❏ Background Operations: Typically not directly accessed or modified by users, functioning behind the scenes. ❏ Foundational Component: Integral part of MongoDB's queryable encryption infrastructure. enxcol_.patients.esc //metadata collection2
  • 27. How Read Operation Works in Queryable Encryption?
  • 28. ❏ Query Submission: Application submits a query; MongoDB drivers analyze it. ❏ DEK Encryption: DEKs use AES-CBC-256 to encrypt specific document fields. ❏ Key Protection: DEKs are protected by encrypting them with the CMK. ❏ Query Transmission: Driver sends the query to MongoDB server, representing encrypted fields as ciphertext. ❏ Cryptographic Tags: MongoDB uses tags to fetch the cryptographic token with encrypted data. ❏ Decryption Process: Driver decrypts query results using its keys. ❏ Client Return: Decrypted data is returned to the client in plaintext. How Read Operation Works in Queryable Encryption?
  • 30. ❏ Automatic Queryable Encryption ❏ Driver and libmongocrypt Collaboration ❏ Streamlined Approach ❏ Seamless Operations ❏ Ease of Use and Security ❏ Available in MongoDB Enterprise and Atlas Implicit ( Automatic) Queryable Encryption
  • 31. ❏ Query Initiation ❏ Field Analysis ❏ DEK Retrieval ❏ DEK Decryption ❏ Data Reading ❏ Data Decryption ❏ User Interaction How Automatic Queryable Encryption Works?
  • 33. ❏ Compatibility Note: Queryable Encryption is incompatible with MongoDB Atlas Search. ❏ Server Limitation: Not applicable for MongoDB standalone servers. ❏ Shard Key Restriction: Encrypted fields cannot be used as shard keys. ❏ Collection Renaming Restriction: Renaming collections with encrypted fields is not allowed. ❏ _id Field Exclusion: Encryption cannot be applied to the _id field. ❏ MongoDB 7.0 support only Equality searches ❏ Encryption collection backup not supported for restoration For detailed information, you can refer to the https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/limitations/#std-label -qe-reference-encryption-limits Limitations Of Queryable Encryption
  • 34. ➔ MongoDB Implicit Queryable Encryption https://www.mydbops.com/blog/mongodb-queryable-encryption/ ➔ MongoDB Explicit Queryable Encryption https://www.mydbops.com/blog/mongodb-7-explicit-queryable-encryption/ ➔ MongoDB General Queryable Encryption Video https://www.youtube.com/watch?v=vTM_YlieLBE&t=863s Queryable Encryption Related Blogs