Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of Notebook Data Encrypted with KMS Customer Master Keys for AWS DynamoDB using the AWS console, you can follow these step-by-step instructions:
- Login to AWS Console: Go to the AWS Management Console (https://aws.amazon.com/) and log in using your credentials.
- Navigate to DynamoDB: In the AWS Management Console, search for “DynamoDB” in the services search bar and select DynamoDB from the search results.
- Select the Table: From the DynamoDB dashboard, select the table where the notebook data is stored that needs to be encrypted with AWS managed keys.
- Enable Encryption: Click on the “Manage” tab in the table details page and then click on the “Encryption” tab.
- Edit Encryption Settings: Click on the “Edit” button to edit the encryption settings for the DynamoDB table.
- Select AWS Managed Key: In the Encryption settings, select “AWS managed key” as the key provider instead of “KMS Customer Master Key”.
- Choose AWS Managed CMK: Choose an AWS managed Customer Master Key (CMK) from the list provided. You can select the default AWS managed CMK or create a new one.
- Update Encryption Settings: After selecting the AWS managed CMK, click on the “Save” button to update the encryption settings for the DynamoDB table.
- Monitor Encryption Status: Once the encryption settings are updated, monitor the status to ensure that the notebook data is now encrypted with the AWS managed key.
Using CLI
Using CLI
To remediate the misconfiguration of Notebook Data Encrypted with KMS Customer Master Keys for AWS DynamoDB using AWS CLI, follow these steps:Step 1: Identify the DynamoDB table that has the misconfiguration:Step 2: Update the DynamoDB table to enable encryption with AWS managed keys:Step 3: Verify that the encryption has been updated successfully:By following these steps, you can remediate the misconfiguration of Notebook Data Encrypted with KMS Customer Master Keys for AWS DynamoDB using AWS CLI.
Using Python
Using Python
To remediate the misconfiguration of notebook data being encrypted with KMS Customer Master Keys in AWS DynamoDB using Python, follow these steps:
- Update the DynamoDB Table Encryption: Configure the DynamoDB table to use AWS managed encryption instead of KMS Customer Master Keys. You can do this by updating the table settings to use the default AWS managed encryption.
- Install the AWS SDK for Python (Boto3): If you haven’t already, install the Boto3 library, which is the AWS SDK for Python. You can install it using pip:
- Update the DynamoDB Table Encryption Settings: Use the following Python script to update the encryption settings of the DynamoDB table to use the default AWS managed encryption:
- Run the Python Script: Save the above Python script in a file (e.g.,
update_dynamodb_encryption.py) and run it using the Python interpreter. Make sure to replace'your-region'and'your-table-name'with the actual values for your DynamoDB table.
- Verify the Encryption Settings: After running the script, verify that the encryption settings for the DynamoDB table have been successfully updated to use the default AWS managed encryption. You can check this in the AWS Management Console or by using the Boto3 library to describe the table.
Using Terraform
Using Terraform
REPLACE_WITH_TABLE_NAMEwith your DynamoDB table name.REPLACE_WITH_HASH_KEY_ATTRIBUTE_NAMEwith the primary key attribute name.- Extend the KMS key policy to include your IAM roles/users as appropriate.
kms_key_arn change) forces replacement of the DynamoDB table in Terraform, which is an outage-prone operation and will destroy/recreate the table and its data unless you manage migration separately.For verification, terraform plan should show:- On a new table: creation of
aws_kms_key.DDB_KMS_KEYandaws_dynamodb_table.THIS_TABLEwithserver_side_encryptionenabled,sse_type = "KMS", andkms_key_arnset. - On an existing table: a planned destroy/create of
aws_dynamodb_table.THIS_TABLEwith the newserver_side_encryptionconfiguration using your CMK.

