Encryption at Rest

Encryption at Rest refers to the process of encrypting data when it is stored within a database system such as MongoDB. The goal is to protect sensitive information from unauthorized access in cases like a security breach or if the database server is physically stolen.

Benefits

How it Works in MongoDB

MongoDB Enterprise edition supports encryption at rest using WiredTiger, the default storage engine. It internally uses libsodium library to perform encryption and decryption operations. The encryption process has three major components:

Configuring Encryption at Rest

To enable encryption at rest in MongoDB, you have to perform the following steps:

Example mongod.conf file:

storage:
  wiredTiger:
    engineConfig:
      encryptWith: 'AES256-CBC'
      encryptionKeyManager:
        keyLocation: '/path/to/encryption/key'
        keyManagement: 'local'

Start MongoDB with:

mongod --config /etc/mongod.conf

By configuring encryption at rest, you are now providing an added layer of security to your MongoDB database, making it more difficult for unauthorized users to access sensitive information while ensuring compliance with regulatory requirements.