Securing ALB Using CloudFront and Custom HTTP Header

Securing ALB Using CloudFront and Custom HTTP Header
Securing ALB Using CloudFront and Custom HTTP Header

CLOUD LABS



Securing ALB Using CloudFront and Custom HTTP Header

In this Cloud Lab, you’ll learn how to secure your internet-facing ALB using a custom HTTP header with CloudFront.

8 Tasks

intermediate

1hr 30m

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

An understanding of CloudFront distribution to secure Application Load Balancer against distributed denial-of-service (DDoS) attacks
A thorough understanding of using CloudFront with ALB as the origin
The ability to add custom headers to requests using the CloudFront distribution
Working knowledge of configuring Application Load Balancer to allow requests only with custom header
Hands-on experience improving the security of a web application using a custom header

Technologies
CloudFront
EC2 logoEC2
ALB logoALB
Cloud Lab Overview

An internet-facing Application Load Balancer is vulnerable to cyberattacks, especially when used with a CloudFront distribution. To secure the application from attackers, you can customize your CloudFront distribution and the Application Load Balancer to only allow requests with a custom header. This methodology helps secure the Application Load Balancer from attacker requests.

In this Cloud Lab, you’ll launch an EC2 instance hosting a static web page. Next, you’ll create a target group with the EC2 instance and an Application Load Balancer to route traffic to our EC2 instance. You’ll create a CloudFront distribution with Application Load Balancer as the origin. Then, you’ll simulate a denial-of-service (DoS) attack aimed at the Application Load Balancer. Moving on, you’ll modify the origin in the CloudFront distribution to add a custom header to the requests directed toward the Application Load Balancer. You’ll also add a custom rule to only forward the traffic with a custom header to the target group and return a 403 access denied error to the rest of the traffic. Finally, you’ll test the application to ensure that the traffic without a header is denied access.

By the end of this Cloud Lab, you’ll be well-equipped to secure your Application Load Balancer using custom headers. In addition, you’ll learn to use CloudFront with Application Load Balancer as the origin.

The following is the high-level architecture diagram of the final infrastructure that you will build in this Cloud Lab:

Architecture diagram
Architecture diagram

Cloud Lab Tasks
1.Introduction
Getting Started
2.Deploy the Initial Infrastructure
Launch an EC2 Instance
Create an Application Load Balancer
Create a CloudFront Distribution
3.Secure the Application
Configure the CloudFront Distribution
Configure an Application Load Balancer (ALB)
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Before you start...

Try these optional labs before starting this lab.

Relevant Courses

Use the following content to review prerequisites or explore specific concepts in detail.

Trusted by 1.4 million developers working at companies including

Don’t take our word for it. See what our developers have to say.

Your method is simple, straight to the point and I can practice with it everywhere, even from my phone, that's something I have never had in other learning platforms.

Felipe Matheus
TestimonialsImg

I highly recommend Educative. The courses are well organized and easy to understand.

Adina Ong
TestimonialsImg

I prefer Educative courses because they have a nice mix of text & images. I find that with full video courses, it can often be too easy to go into passive learning mode.

Clifford Fajardo
TestimonialsImg

I prefer Educative courses because they have a nice mix of text & images. I find that with full video courses, it can often be too easy to go into passive learning mode.

Clifford Fajardo
TestimonialsImg
Don’t take our word for it. See what our developers have to say.

Your method is simple, straight to the point and I can practice with it everywhere, even from my phone, that's something I have never had in other learning platforms.

Felipe Matheus
TestimonialsImg

I highly recommend Educative. The courses are well organized and easy to understand.

Adina Ong
TestimonialsImg

I prefer Educative courses because they have a nice mix of text & images. I find that with full video courses, it can often be too easy to go into passive learning mode.

Clifford Fajardo
TestimonialsImg

Get access to Educative Cloud Labs

Course Footer Image
Course Footer Image