April 25, 2024, 2:50 p.m. | Alexander Adamski

System Weakness - Medium systemweakness.com

Limit Requests to EC2 Instances to Cloudflare IP Ranges

To enhance the security of EC2 instances developers may wish to limit the access to their servers to Cloudflare IP ranges only.

In this guide, we will set up an AWS Lambda function, that automatically updates a security group to whitelist every Cloudflare IP on Port 80 and 443.

First, create a new security group on EC2. Add a name and delete the default rule:

Create the group and take note …

aws aws lambda cloudflare security vps

Technical Senior Manager, SecOps | Remote US

@ Coalfire | United States

Global Cybersecurity Governance Analyst

@ UL Solutions | United States

Security Engineer II, AWS Offensive Security

@ Amazon.com | US, WA, Virtual Location - Washington

Senior Cyber Threat Intelligence Analyst

@ Sainsbury's | Coventry, West Midlands, United Kingdom

Embedded Global Intelligence and Threat Monitoring Analyst

@ Sibylline Ltd | Austin, Texas, United States

Senior Security Engineer

@ Curai Health | Remote