Lesson 06 — Amazon EBS Encryption & AMIs
Learning Path
☁️ Phase 2 – AWS Cloud Security
📘 Module 05 – Amazon EC2 Security
🎯 Lesson Objective
Section titled “🎯 Lesson Objective”By the end of this lesson, you will be able to:
- Understand Amazon Elastic Block Store (EBS).
- Explain how EBS encryption works.
- Understand AWS Key Management Service (AWS KMS).
- Create encrypted EBS volumes.
- Understand Amazon Machine Images (AMIs).
- Create custom AMIs.
- Deploy EC2 instances from custom AMIs.
- Apply enterprise security best practices.
📚 Lesson Information
Estimated Time: 2.5 Hours
Difficulty: Intermediate
Prerequisites: Lesson 05 – IAM Roles for EC2
Hands-on Lab: Yes
💼 Business Scenario
Section titled “💼 Business Scenario”CloudNova Technologies is preparing to launch hundreds of production servers.
The Security Team has established the following requirements:
- Every server must use encrypted storage.
- All production servers must use a standard operating system.
- Security tools must already be installed.
- Company security policies must already be configured.
- New servers should be deployable within minutes.
To achieve this, CloudNova will use:
- Amazon EBS Encryption
- AWS KMS
- Custom Amazon Machine Images (AMIs)
🤔 What is Amazon EBS?
Section titled “🤔 What is Amazon EBS?”Amazon Elastic Block Store (EBS) is persistent block storage for EC2 instances.
Think of it as the hard disk attached to a virtual server.
An EBS volume stores:
- Operating System
- Applications
- Configuration Files
- Logs
- Databases
- User Data
Unlike the EC2 instance itself, an EBS volume can continue to exist even if the instance is stopped.
Amazon EBS Architecture
Section titled “Amazon EBS Architecture” Amazon EC2
│
Amazon EBS Volume
│
Encrypted Data StorageWhy Encrypt EBS?
Section titled “Why Encrypt EBS?”Imagine someone gains unauthorised access to an EBS snapshot.
Without encryption:
Snapshot
↓
Read Data
↓
Sensitive Information ExposedWith encryption:
Encrypted Snapshot
↓
Encrypted Data
↓
AWS KMS Key RequiredEven if the snapshot is copied, the data remains protected.
Benefits of EBS Encryption
Section titled “Benefits of EBS Encryption”✅ Data protected at rest
✅ Automatic encryption
✅ Snapshot encryption
✅ Integrated with AWS KMS
✅ Minimal performance impact
✅ Supports compliance requirements
What is AWS KMS?
Section titled “What is AWS KMS?”AWS Key Management Service (KMS) manages encryption keys used by AWS services.
KMS provides:
- Secure key storage
- Automatic key rotation (configurable)
- Access control
- Audit logging
- Encryption and decryption operations
Encryption Workflow
Section titled “Encryption Workflow”Application
↓
Amazon EC2
↓
Amazon EBS
↓
AWS KMS
↓
Encrypted StorageThe application does not manage encryption keys directly.
AWS handles encryption transparently.
Default AWS Managed Key
Section titled “Default AWS Managed Key”AWS automatically provides:
aws/ebsThis AWS managed key is suitable for many environments.
Large enterprises often create customer managed KMS keys (CMKs) to gain more control over:
- Key rotation
- Access permissions
- Audit requirements
- Separation of duties
Types of EBS Volumes
Section titled “Types of EBS Volumes”| Volume | Use Case |
|---|---|
| gp3 | General purpose workloads |
| io2 | High-performance databases |
| st1 | Throughput-intensive workloads |
| sc1 | Cold storage workloads |
CloudNova standard:
gp3for application servers.
What is an AMI?
Section titled “What is an AMI?”An Amazon Machine Image (AMI) is a template used to launch EC2 instances.
An AMI contains:
- Operating System
- Installed Software
- Security Configuration
- System Updates
- Application Packages
- Boot Configuration
Instead of configuring every server manually, organisations deploy from a standard AMI.
AMI Architecture
Section titled “AMI Architecture”Amazon Linux
↓
Security Updates
↓
Monitoring Agent
↓
CloudWatch Agent
↓
Security Tools
↓
Create AMI
↓
Launch New ServersWhy Enterprises Use Custom AMIs
Section titled “Why Enterprises Use Custom AMIs”CloudNova builds a standard server image.
Every server already includes:
- Amazon Linux
- Latest patches
- CloudWatch Agent
- Systems Manager Agent
- Security monitoring tools
- Company configurations
- Approved software
This ensures every server starts from a trusted baseline.
CloudNova Secure Image
Section titled “CloudNova Secure Image”CloudNova-Secure-AMI-v1
├── Amazon Linux 2023├── Latest Security Updates├── CloudWatch Agent├── Systems Manager Agent├── Security Policies├── Company Banner├── Monitoring Scripts└── Approved PackagesNew servers launched from this AMI are consistent and easier to manage.
Difference Between Snapshots and AMIs
Section titled “Difference Between Snapshots and AMIs”| Snapshot | AMI |
|---|---|
| Backup of an EBS volume | Complete server template |
| Stores storage data | Stores OS, configuration and storage mapping |
| Used for recovery | Used for deployment |
| Can exist independently | May reference one or more snapshots |
Enterprise Image Lifecycle
Section titled “Enterprise Image Lifecycle”Launch Base Server
↓
Install Updates
↓
Install Security Tools
↓
Configure Policies
↓
Test
↓
Create AMI
↓
Launch Production ServersThis process helps maintain a standard operating environment.
🛠 Lab 01 — Verify EBS Encryption
Section titled “🛠 Lab 01 — Verify EBS Encryption”Open:
AWS Console
↓
EC2
↓
Instances
↓
CloudNova-App-Server-01Select:
Storage
↓
Volume IDReview:
- Volume Type
- Encryption Status
- Size
- KMS Key
Confirm that encryption is enabled.
🛠 Lab 02 — Create an Encrypted EBS Volume
Section titled “🛠 Lab 02 — Create an Encrypted EBS Volume”Navigate to:
EC2
↓
Elastic Block Store
↓
Volumes
↓
Create VolumeConfigure:
| Setting | Value |
|---|---|
| Volume Type | gp3 |
| Size | 10 GiB |
| Availability Zone | Same as EC2 Instance |
| Encryption | Enabled |
| KMS Key | aws/ebs |
Click:
Create Volume🛠 Lab 03 — Attach the Volume
Section titled “🛠 Lab 03 — Attach the Volume”Select:
Volume
↓
Actions
↓
Attach VolumeChoose:
CloudNova-App-Server-01Device Name:
/dev/sdfAttach the volume.
🛠 Lab 04 — Verify the Volume
Section titled “🛠 Lab 04 — Verify the Volume”Connect to the EC2 instance.
Run:
lsblkExpected:
xvda
xvdfThe new encrypted volume should be visible.
🛠 Lab 05 — Create a Snapshot
Section titled “🛠 Lab 05 — Create a Snapshot”Navigate to:
Volumes
↓
Actions
↓
Create SnapshotName:
CloudNova-App-SnapshotVerify the snapshot inherits encryption from the source volume.
🛠 Lab 06 — Create a Custom AMI
Section titled “🛠 Lab 06 — Create a Custom AMI”Navigate to:
EC2
↓
Instances
↓
CloudNova-App-Server-01
↓
Actions
↓
Image and Templates
↓
Create ImageConfigure:
Name:
CloudNova-Secure-AMI-v1Description:
Enterprise Secure Gold ImageClick:
Create ImageAWS creates the required snapshots and registers the AMI.
🛠 Lab 07 — Launch an EC2 Instance from the AMI
Section titled “🛠 Lab 07 — Launch an EC2 Instance from the AMI”Navigate to:
EC2
↓
AMIs
↓
CloudNova-Secure-AMI-v1
↓
Launch InstanceVerify:
- Applications are present.
- Security configuration is retained.
- Monitoring agents are installed.
- Storage remains encrypted.
💻 AWS CLI Lab
Section titled “💻 AWS CLI Lab”Describe Volumes
Section titled “Describe Volumes”aws ec2 describe-volumesCreate an Encrypted Volume
Section titled “Create an Encrypted Volume”aws ec2 create-volume \ --availability-zone ap-south-1a \ --size 10 \ --volume-type gp3 \ --encryptedAttach a Volume
Section titled “Attach a Volume”aws ec2 attach-volume \ --volume-id vol-xxxxxxxx \ --instance-id i-xxxxxxxx \ --device /dev/sdfDescribe Snapshots
Section titled “Describe Snapshots”aws ec2 describe-snapshots \ --owner-ids selfCreate an AMI
Section titled “Create an AMI”aws ec2 create-image \ --instance-id i-xxxxxxxx \ --name CloudNova-Secure-AMI-v1Describe AMIs
Section titled “Describe AMIs”aws ec2 describe-images \ --owners self✅ Verification
Section titled “✅ Verification”Verify:
✔ EBS volume is encrypted.
✔ Correct KMS key is used.
✔ Snapshot is created successfully.
✔ Custom AMI is available.
✔ EC2 instance launches successfully from the AMI.
✔ Applications and configuration are retained.
🔍 Troubleshooting
Section titled “🔍 Troubleshooting”Problem
Section titled “Problem”Volume cannot be attached.
Check:
- Availability Zone matches the EC2 instance.
- Volume state is Available.
- Correct device name is used.
Problem
Section titled “Problem”AMI creation fails.
Verify:
- EC2 instance is in a stable state.
- Required IAM permissions exist.
- AWS service limits are not exceeded.
Problem
Section titled “Problem”Encryption disabled.
Review:
- EBS encryption settings.
- Selected KMS key.
- Default EBS encryption configuration for the AWS account.
Problem
Section titled “Problem”Snapshot unavailable.
Check:
- Snapshot creation status.
- IAM permissions.
- AWS Region.
🏢 Enterprise Best Practices
Section titled “🏢 Enterprise Best Practices”CloudNova standards:
- Encrypt every EBS volume.
- Enable default EBS encryption at the account level.
- Use customer managed KMS keys for sensitive production workloads where organisational policy requires it.
- Build and maintain approved Gold AMIs.
- Patch AMIs regularly.
- Remove outdated AMIs.
- Test AMIs before production deployment.
- Tag AMIs with version numbers.
- Automate image creation where possible.
🚫 Common Mistakes
Section titled “🚫 Common Mistakes”❌ Launching unencrypted EBS volumes.
❌ Creating production servers from outdated AMIs.
❌ Forgetting to update Gold Images.
❌ Using different operating system versions across servers without a documented reason.
❌ Leaving unused AMIs and snapshots unmanaged.
❌ Not testing custom AMIs before deployment.
🧪 DIY Challenge
Section titled “🧪 DIY Challenge”Create your own secure enterprise image.
Requirements:
- Amazon Linux 2023
- Latest operating system updates
- CloudWatch Agent installed
- Systems Manager Agent verified
- EBS encryption enabled
- Enterprise tags applied
Create:
CloudNova-Gold-Image-v1Then:
- Launch a second EC2 instance from the new AMI.
- Compare it with the original server.
- Verify that encryption, software and configuration are consistent.
Capture screenshots of:
- EBS Volume
- Encryption Details
- Snapshot
- Custom AMI
- EC2 Instance launched from the AMI
- AWS CLI outputs
📊 Knowledge Check
Section titled “📊 Knowledge Check”- What is Amazon EBS?
- Why should EBS volumes be encrypted?
- What role does AWS KMS play in EBS encryption?
- What is the difference between an EBS Snapshot and an AMI?
- Why do enterprises build custom AMIs?
- What information is stored in an AMI?
- Which EBS volume type is commonly used for general-purpose workloads?
- Why should Gold Images be updated regularly?
- Which AWS CLI command creates an AMI?
- How does EBS encryption help protect sensitive business data?
💡 Key Takeaways
Section titled “💡 Key Takeaways”After completing this lesson, you should understand:
- Amazon EBS provides persistent storage for EC2 instances and should be encrypted to protect data at rest.
- AWS KMS manages the encryption keys used by EBS, helping organisations meet security and compliance requirements.
- Amazon Machine Images (AMIs) provide a repeatable and consistent method for deploying secure EC2 instances.
- Custom Gold AMIs improve standardisation, reduce deployment time and support enterprise operational practices.
- Combining encrypted EBS volumes with well-maintained AMIs creates a secure foundation for production compute environments.
🚀 Next Lesson
Section titled “🚀 Next Lesson”➡️ Lesson 07 — AWS Systems Manager & Session Manager