This rule ensures that EBS default encryption is enabled to enhance data security.
Rule | EBS default encryption should be enabled |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Medium |
Rule Description
The rule states that EBS default encryption should be enabled for AWS Foundational Security Best Practices. EBS (Elastic Block Store) is a block storage service provided by AWS, and enabling default encryption ensures that data stored on EBS volumes is automatically encrypted at rest.
Enabling default encryption helps protect sensitive data and maintain compliance with security regulations. It ensures that even if someone gains unauthorized access to the underlying storage, the data is still encrypted and unreadable.
Troubleshooting Steps
If default encryption for EBS volumes is not enabled, you can follow these troubleshooting steps to enable it:
aws ec2 describe-account-attributes --attribute-names defaultEncryptionEnabled
If the command output shows that defaultEncryptionEnabled is set to false, default encryption is not enabled.
To enable default encryption, you need to modify your account attributes using the AWS CLI:
aws ec2 modify-account-attribute --attribute-name defaultEncryptionEnabled --attribute-value true
Code
In case you want to automate the process of enabling default encryption for EBS volumes, you can use the following AWS CLI command:
aws ec2 modify-account-attribute --attribute-name defaultEncryptionEnabled --attribute-value true
This command will enable default encryption for EBS volumes in your AWS account.
Remediation Steps
Follow these step-by-step instructions to enable default encryption for EBS volumes:
Open the AWS Management Console and navigate to the EC2 service.
In the EC2 Dashboard, click on "Account Attributes" under the "Account Attributes" section on the left-hand side of the page.
On the Account Attributes page, locate the "Default EBS Encryption" setting. If it is set to "Disabled," click on the "Edit" button.
In the Edit Attribute Value dialog box, select "Enable" for the Default EBS Encryption option.
Click on the "Save" button to save the changes.
After saving the changes, verify that default encryption is enabled by running the describe-account-attributes command using the AWS CLI:
aws ec2 describe-account-attributes --attribute-names defaultEncryptionEnabled
The output should now show that defaultEncryptionEnabled is set to "true," indicating that default encryption is enabled for EBS volumes.
By following these steps, you have successfully enabled default encryption for EBS volumes in your AWS account, meeting the AWS Foundational Security Best Practices.