Customer Key Management with AWS KMS¶
On this page
Serverless instances are in preview and do not support this feature at this time. To learn more, see Serverless Instance Limitations.
You can configure your Atlas project to use an AWS IAM role for accessing your AWS KMS keys for encryption at rest. You can either use an existing role or create a new role when you enable encryption at rest for your project.
This page covers configuring customer key management on your Atlas project for role-based access.
If you have not yet enabled encryption at rest for your new or existing Atlas project, follow the Enable Role-Based Access to Your Encryption Key for a Project procedure to enable encryption at rest for your Atlas project. If you have an Atlas project for which you have already enabled encryption at rest and configured credentials-based access to your encryption keys, follow the Switch to Role-Based Access to Your Encryption Key for a Project procedure to switch to role-based access to your encryption keys.
You must configure customer key management for the Atlas project before enabling it on clusters in that project.
To enable customer-managed keys with AWS KMS for a MongoDB project, you must:
- Use an M10 or larger cluster.
- Use Cloud Backups to encrypt your backup snapshots. Legacy Backups are not supported.
- Have an AWS customer master key (CMK). To learn how to create a key, see Creating Keys in the AWS documentation.
Have an AWS IAM user with sufficient privileges. Atlas must have permission to perform the following actions with your key:Note
If you wish to use the AWS CMK with an AWS IAM user from a different AWS account instead of the IAM user who created the AWS CMK, ensure you have sufficient privileges:
- Add a key policy statement under the AWS CMK to include the external AWS account.
- Add an IAM inline policy for the IAM user in the external AWS account.
For a comprehensive discussion of IAM roles and customer master keys, see the AWS documentation.
After confirming the above privileges, you can follow the usual steps to configure the KMS settings in Atlas, with the following exception:
- You must provide the full ARN for
the CMK (e.g.
arn:aws:kms:eu-west-2:111122223333:key/12345678-1234-1234-1234-12345678) instead of the master key ID (e.g.
12345678-1234-1234-1234-12345678) in the CMK ID field.
To learn how to create an IAM user, see IAM Users in the AWS documentation.
Atlas uses the same IAM user credentials and CMK settings for all clusters in a project for which Encryption at Rest is enabled.
- If your AWS KMS configuration requires it, allow access from Atlas IP addresses and the public IP addresses or DNS hostnames of your cluster nodes so that Atlas can communicate with your KMS. If the node IP addresses change, you must update your configuration to avoid connectivity interruptions.
Enable Role-Based Access to Your Encryption Key for a Project¶
Switch to Role-Based Access to Your Encryption Key for a Project¶
If you switch your Atlas project from credentials-based access to role-based access to your encryption keys, you cannot undo the role-based access configuration and revert to credentials-based access for that project.
Enable Customer Key Management for an Atlas Cluster¶
After you Enable Role-Based Access to Your Encryption Key for a Project, you must enable customer key management for each Atlas cluster that contains data that you want to encrypt.
You must have the
Project Owner role to
enable customer key management for clusters in that project.
For new clusters, toggle the Manage your own encryption keys setting to Yes when you create the cluster.
For existing clusters:
Navigate to the Database Deployments page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
- If the Database Deployments page is not already displayed, click Database in the sidebar.
Modify the cluster's configuration.¶
For the cluster that contains data that you want to encrypt, click the ellipses ..., then select Edit Configuration.
Enable cluster encryption.¶
- Expand the Additional Settings panel.
- Toggle the Manage your own encryption keys setting to Yes.
Review and apply your changes.¶
- Click Review Changes.
- Review your changes, then click Apply Changes to update your cluster.