Detecting Unencrypted EBS Volumes Using AWS Config
Introduction
Data-at-rest security is a critical aspect of cloud security. In AWS, Amazon Elastic Block Store (EBS) volumes are commonly used to store application data, operating system files, and logs for EC2 instances. If these volumes are not encrypted, sensitive data may be exposed in the event of unauthorized access or snapshot leakage.
In this project, I implemented a solution using AWS Config to automatically detect unencrypted EBS volumes, validate the detection, and remediate the issue. This demonstrates how organizations can enforce continuous compliance for data-at-rest encryption
Project Overview
The goal of this project was to:
Monitor EBS volumes using AWS Config
Detect EBS volumes that are not encrypted
Validate the detection using a real EC2 workload
AWS services used:
AWS Config
Amazon EC2
Amazon EBS
AWS KMS (for encryption)
Step 1: Enable AWS Config
AWS Config was enabled to record configuration changes for all supported resources.
Key settings:
All resources recorded
Global resources enabled
S3 bucket configured for configuration history
To enable recording, go to settings and click on “start recording”
Explanation: AWS Config continuously evaluates AWS resources against defined compliance rules, allowing security teams to detect misconfigurations automatically.

Step 2: Add the ENCRYPTED_VOLUMES Rule
Navigate to AWS Config → Rules
Add an AWS managed rule
Select: ENCRYPTED_VOLUMES
Save the rule with default settings
What this rule does: It checks whether EBS volumes are encrypted using AWS Key Management Service (KMS).
✅ Encrypted volume → COMPLIANT
❌ Unencrypted volume → NON_COMPLIANT

Step 3: Create an EC2 Instance
To simulate a real production scenario:
launched an EC2 instance. link to create an ec2 instance
The instance automatically came with a default root EBS volume
Note: This default volume was encrypted by default
Why this step matters: EBS volumes are typically used in conjunction with EC2 instances. Testing encryption in isolation is less realistic than attaching volumes to a running instance.

Step 4: Create an Unencrypted EBS Volume
Navigate to EC2 → Volumes
Create a new volume with:
Volume type: gp3
Size: 8 GiB or (leave as default)
select the AZ where your EC2 is running
Don’t tick this box: ❌ Encryption disabled
⚠️ Important: The EBS volume must be created in the same Availability Zone (AZ) as the EC2 instance. EBS volumes can only be attached to EC2 instances within the same AZ.

Step 5: Detach the Default EBS Volume
When an EC2 instance is launched, AWS automatically attaches a default root EBS volume, which is usually encrypted by default.
To detach it:
- STOP THE EC2 INSTANCE
Navigate to EC2 → Volumes
Select the default EBS volume attached to the EC2 instance
Click Actions → Detach volume
Confirm the detachment

Step 6: Attach the Unencrypted EBS Volume
Next, attach the unencrypted EBS volume created earlier.
In EC2 → Volumes, select the unencrypted EBS volume you created
Click Actions → Attach volume
Select the EC2 instance
Choose a device name (for example:
/dev/xvdf)Click Attach
⚠️ Important:
The EBS volume must be in the same Availability Zone (AZ) as the EC2 instance, otherwise it cannot be attached.

Step 7: Test (Observe Non-Compliance in AWS Config)
Start your EC2 Instance
Return to AWS Config → Rules
Select ENCRYPTED_VOLUMES
After evaluation, the unencrypted volume is flagged as:
❌ NON_COMPLIANT
Details include:
Volume ID

Remediate the Issue (Encrypt the Volume)
AWS does not allow in-place encryption of existing EBS volumes. The correct remediation approach is:
Create a snapshot of the unencrypted volume
Copy the snapshot and enable encryption
Create a new EBS volume from the encrypted snapshot
Detach the unencrypted volume
Attach the encrypted volume to the EC2 instance
Why AWS enforces this: This approach preserves data integrity and prevents corruption during encryption.
(Insert screenshot: Snapshot encryption process)
Step 8: Verify Compliance After Remediation
Return to AWS Config → ENCRYPTED_VOLUMES
Wait for re-evaluation
Result: ✅ COMPLIANT
Conclusion
This project demonstrates how AWS Config can be used to detect and remediate unencrypted EBS volumes in a realistic EC2 environment. By enforcing encryption at rest, organizations can significantly reduce the risk of data exposure and meet compliance requirements.

