Applying Multilayer API Security Using Cognito and WAF

Applying Multilayer API Security Using Cognito and WAF
Applying Multilayer API Security Using Cognito and WAF

CLOUD LABS



Applying Multilayer API Security Using Cognito and WAF

In this Cloud Lab, you’ll learn how to secure APIs using Amazon API Gateway, Lambda, Aurora MySQL, WAF, and Cognito to prevent SQL injections and unauthorized access.

8 Tasks

intermediate

2hr

Certificate of Completion

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

Learning Objectives

The ability to secure your applications from SQL attacks using AWS WAF
Working knowledge of allowing authorized access to our API using Amazon Cognito
Hands-on experience creating APIs that fetches data from Aurora MySQL database
Familiarity with safeguarding APIs from unauthorized access and malicious traffic

Technologies
WAF
Cognito
API Gateway logoAPI Gateway
Lambda logoLambda
Aurora logoAurora
Cloud Lab Overview

APIs are typically used to enable application integration, facilitate communication between application components, and provide an abstraction layer for accessing backend services, including databases, within an organization. Security is a top concern for developers, as it is crucial to create APIs protected against vulnerabilities such as SQL injection attacks and unauthorized access. To address these concerns, developers often design architectures that implement security at multiple API layers to ensure robust protection against vulnerabilities and unauthorized access.

You’ll set up an API using Amazon API Gateway in this Cloud Lab. This API will invoke a Lambda function that will retrieve data from an Aurora MySQL database and return it as a response to the API request. After deploying this API, you’ll notice that our API is not secure. APIs can be vulnerable to SQL injection attacks without proper security, allowing attackers to manipulate database queries. Additionally, if the API’s invoke URL is not adequately protected, unauthorized users could access and retrieve data from the database.

To prevent this, you’ll secure the API as follows:

  • Create a WAF rule to protect your APIs from SQL injection attacks.

  • Create a user pool in Amazon Cognito to ensure only authorized people can access your API.

After completing this Cloud Lab, you can use AWS WAF and Cognito to deploy secure APIs. A high-level architecture diagram for this Cloud Lab is given below:

Securing APIs using WAF and Cognito
Securing APIs using WAF and Cognito

Cloud Lab Tasks
1.Introduction
Getting Started
2.Set Up the API
Create an Aurora Cluster
Create a Lambda Function
Create an API
3.Apply Multilayer Security to API
Secure the API with WAF
Secure the API Using Cognito
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.

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