DocumentDB cluster storage is encrypted at rest
Amazon DocumentDB clusters are assessed for storage encryption at rest via the cluster's encrypted setting.
It identifies clusters where data volumes, automated backups, and snapshots aren't protected by AWS KMS-managed encryption.
Risk
Without at-rest encryption, cluster data, snapshots, and backups can be read in plaintext if copies are leaked, mis-shared, or underlying storage is accessed. This harms confidentiality, enables offline analysis and data exfiltration, and widens the blast radius of insider or backup repository compromise.
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks documentdb_cluster_storage_encryptedRecommendation
Enable storage encryption at rest for all DocumentDB clusters and prefer customer-managed KMS keys for control over access, rotation, and revocation. Apply least privilege to key usage, enforce separation of duties, and monitor key and snapshot access. If a cluster isn't encrypted, migrate to a new encrypted cluster.
Remediation
CLI
aws docdb create-db-cluster --db-cluster-identifier <DB_CLUSTER_ID> --engine docdb --master-username <MASTER_USERNAME> --master-user-password <MASTER_PASSWORD> --storage-encryptedTerraform
# Terraform: Encrypted DocumentDB cluster
resource "aws_docdb_cluster" "<example_resource_name>" {
master_username = "<MASTER_USERNAME>"
master_password = "<MASTER_PASSWORD>"
storage_encrypted = true # Critical: enables encryption at rest to pass the check
}NativeIaC
# CloudFormation: Create an encrypted DocumentDB cluster
Resources:
<example_resource_name>:
Type: AWS::DocDB::DBCluster
Properties:
Engine: docdb
MasterUsername: <MASTER_USERNAME>
MasterUserPassword: <MASTER_PASSWORD>
StorageEncrypted: true # Critical: enables encryption at rest to pass the checkOther
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.documentdb.documentdb_client import (
documentdb_client,
)
class documentdb_cluster_storage_encrypted(Check):
def execute(self):
findings = []
for db_cluster in documentdb_client.db_clusters.values():
report = Check_Report_AWS(metadata=self.metadata(), resource=db_cluster)
if db_cluster.encrypted:
report.status = "PASS"
report.status_extended = (
f"DocumentDB Cluster {db_cluster.id} is encrypted at rest."
)
else:
report.status = "FAIL"
report.status_extended = (
f"DocumentDB Cluster {db_cluster.id} is not encrypted at rest."
)
findings.append(report)
return findings