Profile Applicability:
- Level 1
Description:
Amazon DocumentDB provides storage encryption to protect data at rest. By default, DocumentDB clusters are encrypted using AWS Key Management Service (KMS). This SOP ensures that the storage encryption is enabled for DocumentDB clusters, which helps protect sensitive data from unauthorized access and ensures compliance with data protection standards.
Rationale:
Data Protection: Enabling encryption helps ensure that the data at rest within DocumentDB clusters is protected and cannot be accessed by unauthorized parties.
Compliance: Encryption at rest is often required for compliance with standards such as HIPAA, PCI-DSS, and SOC 2.
Security: Protects sensitive customer data and intellectual property from data breaches, providing an additional layer of security for critical applications.
Impact:
Pros:
Enhanced Security: Encryption ensures that data is secure from unauthorized access while at rest in DocumentDB.
Compliance: Meets regulatory and compliance requirements for encryption at rest.
Data Integrity: Provides assurances that data is not altered or compromised while stored in the database.
Cons:
Performance Overhead: Encryption can introduce a slight performance overhead when reading and writing data, although this impact is typically minimal with AWS-managed encryption.
Cost: Depending on the configuration and data size, there may be additional costs associated with KMS usage.
Default Value:
By default, DocumentDB clusters are encrypted at rest using AWS KMS if encryption is enabled at the time of creation. Encryption cannot be enabled or modified after the cluster is created, so it must be configured at creation time.
Pre-requisite:
AWS IAM Permissions:
rds:DescribeDBClusters
rds:DescribeDBInstances
kms:ListAliases
AWS CLI installed and configured.
Ensure that you have permissions to access DocumentDB and KMS resources.
Test Plan:
Using AWS Console:
Sign in to the AWS Management Console.
Navigate to Amazon DocumentDB under Services.
In the DocumentDB Dashboard, go to Clusters.
Select the DocumentDB cluster you want to check.
In the Configuration tab, under the Encryption section, verify if Encryption at Rest is enabled.
If encryption is enabled, it will show Encrypted under the Encryption section.
If encryption is not enabled, it will show Not Encrypted.
If Encryption is not enabled, the cluster will need to be deleted and recreated with encryption enabled.
Using AWS CLI:
To check if encryption is enabled for a DocumentDB cluster, run the following command:
aws rds describe-db-clusters --query 'DBClusters[*].{ClusterIdentifier:DBClusterIdentifier,StorageEncrypted:StorageEncrypted}'
Review the output:
If StorageEncrypted is true, encryption is enabled for the cluster.
If StorageEncrypted is false, encryption is not enabled.
To check the KMS Key used for encryption, run:
aws rds describe-db-clusters --query 'DBClusters[*].{ClusterIdentifier:DBClusterIdentifier,KmsKeyId:KmsKeyId}'
Implementation Steps:
Using AWS Console:
Log in to the AWS Management Console and navigate to Amazon DocumentDB.
In the DocumentDB Dashboard, select Clusters and choose the DocumentDB cluster for which you want to verify encryption.
Under the Configuration tab, verify the Encryption section.
If encryption is not enabled, delete the existing DocumentDB cluster and proceed with creating a new one.
When creating the new cluster, ensure that the Enable Encryption checkbox is selected, and a KMS Key is specified.
Using AWS CLI:
To enable encryption for a new DocumentDB cluster, use the following command when creating the cluster:
aws rds create-db-cluster --db-cluster-identifier <db-cluster-id> --engine docdb --master-username <username> --master-user-password <password> --kms-key-id <kms-key-id> --enable-cloudwatch-logs-exports <logs-to-export> --apply-immediately
To check if encryption is enabled after creation, use:
aws rds describe-db-clusters --query 'DBClusters[*].{ClusterIdentifier:DBClusterIdentifier,StorageEncrypted:StorageEncrypted}'
Backout Plan:
Using AWS Console:
If enabling encryption causes issues, sign in to the AWS Management Console.
Navigate to Amazon DocumentDB and select the new cluster created with encryption enabled.
Delete the cluster (note that encryption cannot be disabled once it is set for the cluster, so a new cluster will need to be created without encryption).
Recreate the cluster without enabling storage encryption if necessary.
Using AWS CLI:
To delete the new cluster created with encryption enabled, run:
aws docdb delete-db-cluster --db-cluster-identifier <NEW_CLUSTER_ID> --skip-final-snapshot
Recreate the cluster without encryption if needed:
aws docdb create-db-cluster --db-cluster-identifier <NEW_CLUSTER_ID> --engine docdb --master-username