Keeping data and applications safe in the cloud is one the most visible challenges facing cloud teams in 2018. Cloud storage services where data resides are frequently a target for hackers, not because the services are inherently weak, but because they are often improperly configured.
Encryption—to protect data at rest and in-flight—should be an organization’s number-one priority when using any storage service. On AWS, its Elastic Block Store (EBS) service provides persistent block-level storage volumes for Amazon EC2 instances. EBS volumes can be attached to your instances and primarily used for data that is rapidly changing or that requires specific input/output operations per second, (IOPS). Because they provide persistent level storage to your instances, EBS volumes are ideally suited for retaining important data and can be used to store personally identifiable information (PII). In any environment where this is the case, it’s essential that data on the volume is encrypted to protect it from malicious activity.
AWS makes encryption easy. In this post, we’ll step through three processes using AWS Elastic Block Store to help you make sure that your encryption is configured correctly.
How to Encrypt an EBS Volume
With the EBS encryption mechanism, you don’t have to worry about managing keys to perform encryption yourself—it’s all managed and implemented by EBS. However, there are a couple of different ways that encryption can be applied depending on how and when you are creating your new EBS volumes. I will walk you through each process.
Encryption for a new EBS Volume
- From within the AWS Management Console, select EC2
- Under ‘Elastic Block Store’ select ‘Volumes’
- Select ‘Create Volume’
- Enter the required configuration for your Volume
- Select the checkbox for ‘Encrypt this volume’
- Select the KMS Customer Master Key (CMK) to be used under ‘Master Key’
- Select ‘Create Volume’
Once your volume has been created, all data saved to this volume will be encrypted when attached to an EC2 instance.
Encrypt a new EBS volume when launching an EC2 instance
- From within the AWS Management Console, select EC2
- Select ‘Launch Instance’
- Select your AMI type
- Select your Instance Type
- Click ‘Next: Configure Instance Details’
- Configure your instance as required
- Select ‘Next: Add Storage’
- Select ‘Add New Volume’
- Ensure your volume type is ‘EBS’ and configure your storage requirements
- Select the drop-down list under ‘Encryption’ and select the KMS CMK key to be used
- Continue with your EC2 instance launch process
The EBS volume attached to that instance will now be encrypted. It’s also worth noting that any snapshots created from these encrypted volumes (and any volumes created from these snapshots) will also be encrypted.
EBS with KMS
The EBS service interacts with another AWS service, the Key Management Service (KMS) to perform encryption. KMS uses Customer Master Keys (CMK) to create Data Encryption Keys (DEK), which enables data encryption across EBS and a range of AWS services.
When a volume is defined as an encrypted volume, EBS sends a request to KMS asking for a Data Encryption Key. The DEK is generated AND encrypted by the Customer Master Key, which by default will be a unique, regional CMK provided by AWS unless otherwise specified. The encrypted DEK is then stored with the metadata on the EBS volume.
It’s important to point out that no data has been encrypted up to this point. So far only the Data Encryption Key has been encrypted. The data encryption process is driven from the EC2 instance, not the EBS volume, so your data will be encrypted when it is connected to an associated EC2 instance.
When the volume is attached to an EC2 instance, the instance sends a ‘decrypt’ request to KMS along with the encrypted DEK from the EBS volume. KMS then responds with a plaintext version of the DEK. EC2 will store this within its hypervisor memory, allowing the instance itself to perform encryption on any read/writes to the EBS volume using the plaintext version of the DEK.
The DEK uses the AES-256 (Advanced Encryption Standard – 256 bit) algorithm to encrypt any data written. The process is managed from the EC2 instance, which ensures that the data is also encrypted when in transit to the EBS volume.
Let’s look at the full process:
- A volume is defined as ‘encrypted’ in EBS
- EBS calls KMS to request a Data Encryption Key
- KMS generates a DEK from the specified Customer Master Key
- The CMK encrypts the DEK
- The DEK is then stored on the encrypted EBS volume as metadata
- The EBS volume is then attached to an EC2 instance
- EC2 sends a ‘decrypt’ request to KMS with the encrypted DEK from the volume
- KMS decrypts the DEK into a plaintext DEK and sends it back to the EC2 instance
- EC2 stores the plaintext DEK in its hypervisor memory for as long as the EBS volume is attached to the instance
- EC2 uses the DEK to perform I/O encryption to the volume using the AES-256 algorithm
How to Encrypt an Existing EBS Volume
An existing unencrypted volume and the data it contains may not be encrypted. Instead, you’ll need to follow another process, outlined below.
1. Select your unencrypted volume
2. Select ‘Actions’ – ‘Create Snapshot’
3. When the snapshot is complete, select ‘Snapshots’ under ‘Elastic Block Store’ Select your newly created snapshot
4. Select ‘Actions’ – ‘Copy’
5. Check the box for ‘Encryption’
6. Select the CMK for KMS to use as required
7. Click ‘Copy’
8. Select the newly created snapshot
9. Select ‘Actions’ – ‘Create Volume’
10. You will notice that the normal ‘Encryption’ option is set to ‘True.’ Because the snapshot is itself encrypted, this cannot be modified. The volume now created from this snapshot will be encrypted
Supported Instance Types for Encryption
Although all EBS volume types support encryption, not all instance types are supported.
The following AWS instance types are supported for EBS encryption:
Image Source: Encryption Supported Instances
Consult the official AWS documentation to stay up to date with the supported instance types.
Now that you understand how your sensitive data can be protected through EBS encryption, you’ll want to learn more about encryption for other AWS services such as Encryption in S3, KMS, Redshift, and CloudHSM.
Get started with these courses from the Cloud Academy Training Library:
AWS Big Data Security: Encryption
Amazon Web Services – Key Management Service (KMS)
Getting started with AWS CloudHSM
Real-Time Application Monitoring with Amazon Kinesis
Amazon Kinesis is a real-time data streaming service that makes it easy to collect, process, and analyze data so you can get quick insights and react as fast as possible to new information. With Amazon Kinesis you can ingest real-time data such as application logs, website clickstre...
Google Vision vs. Amazon Rekognition: A Vendor-Neutral Comparison
Google Cloud Vision and Amazon Rekognition offer a broad spectrum of solutions, some of which are comparable in terms of functional details, quality, performance, and costs. This post is a fact-based comparative analysis on Google Vision vs. Amazon Rekognition and will focus on the tech...
New on Cloud Academy: CISSP, AWS, Azure, & DevOps Labs, Python for Beginners, and more…
As Hurricane Dorian intensifies, it looks like Floridians across the entire state might have to hunker down for another big one. If you've gone through a hurricane, you know that preparing for one is no joke. You'll need a survival kit with plenty of water, flashlights, batteries, and n...
Amazon Route 53: Why You Should Consider DNS Migration
What Amazon Route 53 brings to the DNS table Amazon Route 53 is a highly available and scalable Domain Name System (DNS) service offered by AWS. It is named by the TCP or UDP port 53, which is where DNS server requests are addressed. Like any DNS service, Route 53 handles domain regist...
How to Unlock Complimentary Access to Cloud Academy
Are you looking to get trained or certified on AWS, Azure, Google Cloud Platform, DevOps, Cloud Security, Python, Java, or another technical skill? Then you'll want to mark your calendars for August 23, 2019. Starting Friday at 12:00 a.m. PDT (3:00 a.m. EDT), Cloud Academy is offering c...
What Exactly Is a Cloud Architect and How Do You Become One?
One of the buzzwords surrounding the cloud that I'm sure you've heard is "Cloud Architect." In this article, I will outline my understanding of what a cloud architect does and I'll analyze the skills and certifications necessary to become one. I will also list some of the types of jobs ...
Boto: Using Python to Automate AWS Services
Boto allows you to write scripts to automate things like starting AWS EC2 instances Boto is a Python package that provides programmatic connectivity to Amazon Web Services (AWS). AWS offers a range of services for dynamically scaling servers including the core compute service, Elastic...
Content Roadmap: AZ-500, ITIL 4, MS-100, Google Cloud Associate Engineer, and More
Last month, Cloud Academy joined forces with QA, the UK’s largest B2B skills provider, and it put us in an excellent position to solve a massive skills gap problem. As a result of this collaboration, you will see our training library grow with additions from QA’s massive catalog of 500+...
DevSecOps: How to Secure DevOps Environments
Security has been a friction point when discussing DevOps. This stems from the assumption that DevOps teams move too fast to handle security concerns. This makes sense if Information Security (InfoSec) is separate from the DevOps value stream, or if development velocity exceeds the band...
Test Your Cloud Knowledge on AWS, Azure, or Google Cloud Platform
Cloud skills are in demand | In today's digital era, employers are constantly seeking skilled professionals with working knowledge of AWS, Azure, and Google Cloud Platform. According to the 2019 Trends in Cloud Transformation report by 451 Research: Business and IT transformations re...
Disadvantages of Cloud Computing
If you want to deliver digital services of any kind, you’ll need to estimate all types of resources, not the least of which are CPU, memory, storage, and network connectivity. Which resources you choose for your delivery — cloud-based or local — is up to you. But you’ll definitely want...
Google Cloud vs AWS: A Comparison (or can they be compared?)
The "Google Cloud vs AWS" argument used to be a common discussion among our members, but is this still really a thing? You may already know that there are three major players in the public cloud platforms arena: Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP)...