More Info:
RDS database instances should be encrypted to fulfill compliance requirements for data-at-rest encryption.Risk Level
HighAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- AWS Well Architected Framework
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- GDPR
- HIPAA
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of RDS instances not having encryption enabled in AWS, you can follow these steps using the AWS Management Console:
- Login to AWS Console: Go to the AWS Management Console and login with your credentials.
- Navigate to RDS Dashboard: Click on the “Services” dropdown menu at the top of the page and select “RDS” under the Database category.
- Create a Snapshot of the Unencrypted DB Instance a. Select your DB instance. b. Click on Actions and choose Take snapshot. c. Provide a unique Snapshot Identifier and create the snapshot. d. Copy the Snapshot with Encryption
- Create Encrypted Snapshot from Unencrypted Snapshot a. In the RDS Dashboard, go to Snapshots and select the snapshot you just created. b. Click on Actions and choose Copy snapshot. c. In the copy dialog, enable Encryption by selecting your desired AWS KMS key. d. Specify a new identifier for the encrypted snapshot and start the copy process.
- Restore a New Encrypted DB Instance from the Encrypted Snapshot a. Once the encrypted snapshot is available, select it. b. Click on Actions and choose Restore snapshot. c. Provide a new DB instance identifier and adjust the instance settings as needed. d. Launch the new encrypted instance.
Using CLI
Using CLI
Amazon RDS does not support enabling encryption on an existing unencrypted DB instance. However, you can achieve encryption by creating a new encrypted instance and migrating the data. Here are the steps for AWS CLI:
-
Identify the RDS Instances without Encryption Enabled:
Run the following AWS CLI command to list all RDS instances without encryption enabled:
-
Create a Snapshot:
For each RDS instance identified in the previous step, create a db snapshot using the following command:
Replace
<instance-identifier>with the identifier of the RDS instance that needs encryption enabled. - Iterate through all the instances and perform below steps:
-
Copy the Snapshot with Encryption Enabled:
Replace
<snapshot-id>with the RDS instance snapshot identifier created in the above step. -
Restore a New Encrypted DB Instance from the Encrypted Snapshot:
Once the encryption modification is complete, verify that encryption is enabled for the RDS instance by running:
Replace
<encrypted-snapshot-id>with the Encrypted snapshot identifier created in the above step. -
(Optional) Delete Old Unencrypted Instances:
Using Python
Using Python
Amazon RDS does not support enabling encryption on an existing unencrypted DB instance. However, you can achieve encryption by creating a new encrypted instance and migrating the data. Here are the steps using Python:
-
Import the necessary Python libraries:
-
Initialize the AWS RDS client:
-
Get a list of all RDS instances:
-
Create a snapshot of the current unencrypted DB instance:
-
Create new snapshot with Encryption:
-
Restore to create a new Encrypted database:
Using Terraform
Using Terraform
storage_encrypted = true on an RDS instance that was originally created unencrypted forces replacement: Terraform will destroy the existing instance and create a new, encrypted one. To avoid data loss, follow AWS guidance to create an encrypted snapshot from an unencrypted snapshot and restore it into a new encrypted instance, then import that into Terraform or adjust your state accordingly before applying.After updating Terraform, terraform plan should show the aws_db_instance.THIS_DB resource with storage_encrypted changing from false (or being added) to true, and it will be marked with -/+ indicating it will be replaced.
