Navigation

Customer Key Management with Google Cloud KMS

Feature unavailable in Free and Shared-Tier Clusters

This feature is not available for M0 (Free Tier), M2, and M5 clusters. To learn more about which features are unavailable, see Atlas M0 (Free Tier), M2, and M5 Limitations.

Feature incompatible with Multi-Cloud Clusters

Atlas doesn’t support this feature in multi-cloud clusters at this time.

Atlas uses your GCP Service Account Key to encrypt and decrypt your MongoDB master keys. These MongoDB master keys are used to encrypt cluster database files and cloud providers snapshots.

When you use your own cloud provider KMS, Atlas automatically rotates the MongoDB master keys every 90 days. These keys are rotated on a rolling basis and the process does not require the data to be rewritten.

Atlas encrypts your data at rest using encrypted storage media. Using keys you manage with GCP KMS, Atlas encrypts your data a second time when it writes it to the MongoDB encrypted storage engine. You use your GCP SAK to encrypt the MongoDB master encryption keys.

This page covers configuring customer key management using AKV on your Atlas project.

You must configure customer key management for the Atlas project before enabling it on clusters in that project.

Prerequisites

To enable customer-managed keys with GCP KMS for a MongoDB project, you must have:

  • Use an M10 or larger cluster.

  • Use Cloud Backups to encrypt your backup snapshots. Legacy Backups are not supported.

  • Your GCP Service Account Key.

  • The Key Version Resource ID associated with your Service Account Key.

  • A GCP service account with credentials specified in your Service Account Key with sufficient permissions to:

    • Get the Service Account Key version
    • Encrypt data with the Service Account Key version
    • Decrypt data with the Service Account Key

    Note

    The key, not the key version, handles decryption.

  • If your GCP KMS configuration requires it, allow access from Atlas IP addresses so that Atlas can communicate with your KMS.

Enable Customer-Managed Keys for a Project

You must enable customer key management for a project before you can enable it on a cluster in that project.

1
2

Toggle the button next to Encryption at Rest using your Key Management to On.

3

Select Google Cloud KMS.

4

Enter your Service Account Key.

Your Service Account Key should be formatted as a JSON object. It contains the encryption credentials for your GCP service account.

5

Enter the Key Version Resource ID.

Your key version resource ID is the fully-qualified resource name for a CryptoKeyVersion.

6

Click Save.

Enable Customer Key Management for an Atlas Cluster

After you Enable Customer-Managed Keys for a Project, you must enable customer key management for each Atlas cluster that contains data that you want to encrypt.

Note

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:

1
2

Modify the cluster’s configuration.

For the cluster that contains data that you want to encrypt, click the ellipses , then select Edit Configuration.

3

Enable cluster encryption.

  1. Expand the Additional Settings panel.
  2. Toggle the Manage your own encryption keys setting to Yes.
4

Review and apply your changes.

  1. Click Review Changes.
  2. Review your changes, then click Apply Changes to update your cluster.

Alerts

Atlas automatically creates an encryption key rotation alert once you configure customer key management for a project. You can reset this alert at any time by rotating your GCP Key Version Resource ID.