01 Run copy-db-snapshot command (OSX/Linux/UNIX) using the name of the unencrypted RDS database snapshot as the identifier parameter, to copy the selected snapshot and encrypt its data using the default master key (i.e. AWS-managed key). Replace <aws-region>
and <aws-account-id>
with your own AWS cloud environment details:
aws rds copy-db-snapshot
--region us-east-1
--source-db-snapshot-identifier cc-project5-mysql-database-feb-2021
--target-db-snapshot-identifier cc-encrypted-project5-mysql-database-feb-2021
--kms-key-id arn:aws:kms:<aws-region>:<aws-account-id>:alias/aws/rds
02 The command output should return the metadata of the new Amazon RDS database snapshot:
{
"DBSnapshot": {
"MasterUsername": "ccadmin",
"LicenseModel": "general-public-license",
"InstanceCreateTime": "2021-05-18T15:31:20.677Z",
"Engine": "mysql",
"VpcId": "vpc-abcdabcd",
"SourceRegion": "us-east-1",
"AllocatedStorage": 50,
"Status": "creating",
"PercentProgress": 0,
"SourceDBSnapshotIdentifier": "arn:aws:rds:us-east-1:123456789012:snapshot:cc-project5-mysql-database-feb-2021",
"DBSnapshotIdentifier": "cc-encrypted-project5-mysql-database-feb-2021",
"DBSnapshotArn": "arn:aws:rds:us-east-1:123456789012:snapshot:cc-encrypted-project5-mysql-database-feb-2021",
"EngineVersion": "8.0.20",
"ProcessorFeatures": [],
"OptionGroupName": "default:mysql-8-0",
"AvailabilityZone": "us-east-1a",
"StorageType": "gp2",
"Encrypted": true,
"IAMDatabaseAuthenticationEnabled": false,
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcdabcd-1234-abcd-1234-abcd1234abcd",
"DbiResourceId": "db-ABCDABCDABCDABCDABCD",
"SnapshotType": "manual",
"Port": 3306,
"DBInstanceIdentifier": "cc-project5-mysql-database"
}
}
03 (Optional) You can choose to delete the source (unencrypted) database snapshot. Run delete-db-snapshot command (OSX/Linux/UNIX) using the name of the unencrypted database snapshot as the identifier command parameter, to remove specified snapshot from your AWS cloud account:
aws rds delete-db-snapshot
--region us-east-1
--db-snapshot-identifier cc-project5-mysql-database-feb-2021
04 The command output should return the delete-db-snapshot command request metadata:
{
"DBSnapshot": {
"MasterUsername": "ccadmin",
"LicenseModel": "general-public-license",
"InstanceCreateTime": "2021-05-18T15:31:20.677Z",
"Engine": "mysql",
"VpcId": "vpc-abcdabcd",
"DBSnapshotIdentifier": "cc-project5-mysql-database-feb-2021",
"AllocatedStorage": 20,
"Status": "deleted",
"PercentProgress": 100,
"DBSnapshotArn": "arn:aws:rds:us-east-1:123456789012:snapshot:cc-project5-mysql-database-feb-2021",
"EngineVersion": "8.0.20",
"ProcessorFeatures": [],
"OptionGroupName": "default:mysql-8-0",
"SnapshotCreateTime": "2021-05-18T16:15:44.585Z",
"AvailabilityZone": "us-east-1a",
"StorageType": "gp2",
"Encrypted": false,
"IAMDatabaseAuthenticationEnabled": false,
"DbiResourceId": "db-ABCDABCDABCDABCDABCD",
"SnapshotType": "manual",
"Port": 3306,
"DBInstanceIdentifier": "cc-project5-mysql-database"
}
}
05 Repeat steps no. 1 – 4 for each unencrypted Amazon RDS database snapshot available in the selected AWS region.
06 Change the AWS cloud region by updating the --region command parameter value and repeat the Remediation process for other regions.