{"id":13279,"date":"2025-06-02T21:50:46","date_gmt":"2025-06-02T16:20:46","guid":{"rendered":"https:\/\/seoneurons.com\/blog\/?p=13279"},"modified":"2025-06-08T08:23:39","modified_gmt":"2025-06-08T02:53:39","slug":"allow-only-cloudflares-ip-aws","status":"publish","type":"post","link":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/","title":{"rendered":"How to Whitelist Cloudflare IPs in AWS Using AWS CLI"},"content":{"rendered":"\n<p>When you use Cloudflare to protect your website or application, it acts as a reverse proxy. All user traffic passes through Cloudflare before reaching your AWS EC2 instance. This setup protects your origin server from threats like DDoS attacks, malicious bots, and direct IP scanning.<\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">In this guide, we\u2019ll walk through:<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #494949;color:#494949\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #494949;color:#494949\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#step-1-create-a-new-security-group-in-aws\" >Step 1: Create a New Security Group in AWS<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#1-log-in-to-the-aws-management-console\" >1. Log in to the AWS Management Console<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#2-navigate-to-ec2-dashboard\" >2. Navigate to EC2 Dashboard<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#3-go-to-security-groups\" >3. Go to Security Groups<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#4-click-on-%e2%80%9ccreate-security-group%e2%80%9d\" >4. Click on \u201cCreate Security Group\u201d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#5-fill-in-the-security-group-details\" >5. Fill in the Security Group Details<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#6-configure-inbound-rules\" >6. Configure Inbound Rules<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#7-configure-outbound-rules\" >7. Configure Outbound Rules<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#8-create-the-security-group\" >8. Create the Security Group<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#step-2-access-aws-cli-using-aws-cloudshell-no-local-setup-required\" >Step 2: Access AWS CLI Using AWS CloudShell (No Local Setup Required)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#how-to-access-cloudshell\" >How to Access CloudShell<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#step-3-add-cloudflare-ipv4-to-security-group-using-aws-cli\" >Step 3: Add Cloudflare IPv4 to Security Group Using AWS CLI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#step-4-add-cloudflare-ipv6-to-security-group-using-aws-cli\" >Step 4: Add Cloudflare IPv6 to Security Group Using AWS CLI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#step-5-attach-the-security-group-to-your-ec2-instance-and-remove-the-default-one\" >Step 5: Attach the Security Group to Your EC2 Instance and Remove the Default One<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#steps-to-attach-the-security-group\" >Steps to Attach the Security Group:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#step-6-verify-that-your-ec2-instance-is-now-protected-from-direct-ip-access\" >Step 6: Verify That Your EC2 Instance Is Now Protected from Direct IP Access<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#1-confirm-your-website-loads-via-domain-name\" >1. Confirm Your Website Loads via Domain Name<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#2-try-accessing-directly-via-public-ip-it-should-fail\" >2. Try Accessing Directly via Public IP (It Should Fail)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#3-double-check-security-group-rules\" >3. Double-Check Security Group Rules<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#%e2%9a%a0%ef%b8%8f-important-note-about-file-uploads-dns-proxy-mode\" >\u26a0\ufe0f Important Note About File Uploads &amp; DNS Proxy Mode<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<p>However, if your EC2 instance accepts connections from all IPs, attackers can bypass Cloudflare and hit your server directly using its public IP address. That defeats the purpose of using Cloudflare.<\/p>\n\n\n\n<p>To prevent this, you should allow only Cloudflare&#8217;s IP ranges in your AWS security group. This ensures that only traffic routed through Cloudflare can reach your server, and all other direct connections are denied.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-1-create-a-new-security-group-in-aws\"><span class=\"ez-toc-section\" id=\"step-1-create-a-new-security-group-in-aws\"><\/span>Step 1: Create a New Security Group in AWS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before you can whitelist Cloudflare IPs, you need to create a new security group that will be used specifically for this purpose. This security group will not allow all inbound traffic like the default one. Instead, you&#8217;ll configure it to allow traffic <strong>only from Cloudflare&#8217;s IP ranges<\/strong>.<\/p>\n\n\n\n<p>Here\u2019s how to create a new security group via the AWS Console:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-log-in-to-the-aws-management-console\"><span class=\"ez-toc-section\" id=\"1-log-in-to-the-aws-management-console\"><\/span>1. Log in to the AWS Management Console<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Go to <a href=\"https:\/\/console.aws.amazon.com\/\">https:\/\/console.aws.amazon.com\/<\/a> and log in with your credentials.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-navigate-to-ec2-dashboard\"><span class=\"ez-toc-section\" id=\"2-navigate-to-ec2-dashboard\"><\/span>2. Navigate to EC2 Dashboard<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once logged in, go to the EC2 service. You can find it by searching \u201cEC2\u201d in the top search bar or selecting it from the Services menu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-go-to-security-groups\"><span class=\"ez-toc-section\" id=\"3-go-to-security-groups\"><\/span>3. Go to Security Groups<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>On the left sidebar, under <strong>&#8220;Network &amp; Security&#8221;<\/strong>, click on <strong>&#8220;Security Groups&#8221;<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-click-on-create-security-group\"><span class=\"ez-toc-section\" id=\"4-click-on-%e2%80%9ccreate-security-group%e2%80%9d\"><\/span>4. Click on \u201cCreate Security Group\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>At the top right corner, click the <strong>&#8220;Create security group&#8221;<\/strong> button.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-fill-in-the-security-group-details\"><span class=\"ez-toc-section\" id=\"5-fill-in-the-security-group-details\"><\/span>5. Fill in the Security Group Details<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now you\u2019ll be prompted to fill out the following fields:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Security group name:<\/strong><br>Enter a recognizable name, such as <code>CloudflareOnlyAccess<\/code> or <code>CF-Whitelist<\/code>.<\/li>\n\n\n\n<li><strong>Description:<\/strong><br>Write a brief description, for example: <code>Allow only Cloudflare IPs on ports 80 and 443<\/code>.<\/li>\n\n\n\n<li><strong>VPC:<\/strong><br>Your default VPC will be auto-selected here. If your EC2 instance is part of a specific VPC, make sure to choose that one. Otherwise, leave it as is.<\/li>\n\n\n\n<li><strong>Tags (optional):<\/strong><br>You can add a tag like <code>Name: CloudflareWhitelist<\/code> to help identify this security group later.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-6-configure-inbound-rules\"><span class=\"ez-toc-section\" id=\"6-configure-inbound-rules\"><\/span>6. Configure Inbound Rules<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>For now, <strong>leave the Inbound rules section empty<\/strong>. You&#8217;ll add specific Cloudflare IPs via AWS CLI later.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-7-configure-outbound-rules\"><span class=\"ez-toc-section\" id=\"7-configure-outbound-rules\"><\/span>7. Configure Outbound Rules<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>By default, AWS allows all outbound traffic from your instance. You can leave this as is unless you have a strict need to control outgoing traffic.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-8-create-the-security-group\"><span class=\"ez-toc-section\" id=\"8-create-the-security-group\"><\/span>8. Create the Security Group<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Scroll down and click the <strong>&#8220;Create security group&#8221;<\/strong> button.<\/p>\n\n\n\n<p>Once created, your new security group will appear in the list. Make sure to note down the <strong>Security Group ID<\/strong> (for example, <code>sg-08ea2ffd64093162c<\/code>). You\u2019ll use this ID when adding IPs using the AWS CLI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"587\" src=\"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/create-aws-security-group.png\" alt=\"\" class=\"wp-image-13280\" srcset=\"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/create-aws-security-group.png 1080w, https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/create-aws-security-group-768x417.png 768w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p>At this point, you\u2019ve successfully created a security group with no inbound rules. This means your server won\u2019t accept any incoming traffic unless explicitly allowed \u2014 which is exactly what you want for a locked-down, Cloudflare-only setup.<\/p>\n\n\n\n<p>If all of this feels a bit too technical or you&#8217;re worried about making a misstep that could accidentally expose your server or break your site\u2019s availability, you&#8217;re not alone. Website security is a complex area that needs careful planning \u2014 especially when dealing with firewall rules, CDNs like Cloudflare, and AWS security groups. At <strong>SEO Neurons<\/strong>, <a href=\"https:\/\/seoneurons.com\/website-security\/\">we offer end-to-end website security solutions<\/a> to help you lock down your infrastructure, monitor threats, and stay compliant \u2014 without the guesswork. So whether you&#8217;re just starting or already facing issues, our team can help secure your digital presence effectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"step-2-access-aws-cli-using-aws-cloudshell-no-local-setup-required\"><\/span>Step 2: Access AWS CLI Using AWS CloudShell (No Local Setup Required)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Instead of running AWS CLI commands from your local machine or launching a temporary EC2 instance, the easiest and most secure option is to use <strong>AWS CloudShell<\/strong>.<\/p>\n\n\n\n<p>CloudShell is a browser-based shell provided by AWS, which comes pre-installed with AWS CLI and is already authenticated with your user\u2019s IAM permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"227\" src=\"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/cloudshell-scaled.png\" alt=\"access aws cloudshell\" class=\"wp-image-13283\" srcset=\"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/cloudshell-scaled.png 2560w, https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/cloudshell-768x68.png 768w, https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/cloudshell-1536x136.png 1536w, https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/cloudshell-2048x182.png 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"how-to-access-cloudshell\"><\/span>How to Access CloudShell<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to your AWS Console.<\/li>\n\n\n\n<li>On the top-right corner of the dashboard, click the <strong>\u201cCloudShell\u201d<\/strong> icon.<\/li>\n\n\n\n<li>A terminal window will open at the bottom of your screen. This is a fully managed shell environment with access to AWS CLI.<\/li>\n\n\n\n<li>Ensure that the IAM user or role you&#8217;re logged in with has the necessary permissions to <strong>modify security groups<\/strong>, such as <code>ec2:AuthorizeSecurityGroupIngress<\/code>.<\/li>\n<\/ol>\n\n\n\n<p>Now you&#8217;re ready to run shell scripts directly in AWS without any local setup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"step-3-add-cloudflare-ipv4-to-security-group-using-aws-cli\"><\/span>Step 3: Add Cloudflare IPv4 to Security Group Using AWS CLI<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once CloudShell is open, you can execute the following shell script to whitelist <strong>Cloudflare\u2019s IPv4<\/strong> address ranges.<\/p>\n\n\n\n<p>Replace <code>sg-08ea2ffd64093123c<\/code> with the ID of the security group you created earlier.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# Download Cloudflare IPv4 address ranges\nwget https:\/\/www.cloudflare.com\/ips-v4 -O cloudflare_ips.txt\n\n# Security Group ID\nSG_ID=\"sg-08ea2ffd64093123c\"\n\n# Loop through each IPv4 range and allow ports 80 and 443\nwhile read -r p || &#91;&#91; -n \"$p\" ]]; do\n  aws ec2 authorize-security-group-ingress \\\n    --group-id \"$SG_ID\" \\\n    --ip-permissions \"IpProtocol=tcp,FromPort=80,ToPort=80,IpRanges=&#91;{CidrIp=$p,Description='Cloudflare'}]\"\n\n  aws ec2 authorize-security-group-ingress \\\n    --group-id \"$SG_ID\" \\\n    --ip-permissions \"IpProtocol=tcp,FromPort=443,ToPort=443,IpRanges=&#91;{CidrIp=$p,Description='Cloudflare'}]\"\ndone &lt; cloudflare_ips.txt\n\n# Cleanup\nrm cloudflare_ips.txt\n\necho \"Cloudflare IPv4 IPs have been added to the security group.\"\n<\/code><\/pre>\n\n\n\n<p><strong>How to run the script in CloudShell:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Copy the script above into a file:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>nano add-cloudflare-ipv4.sh\n<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Paste the content, save (<code>Ctrl + O<\/code>), and exit (<code>Ctrl + X<\/code>).<\/li>\n\n\n\n<li>Make it executable and run:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x add-cloudflare-ipv4.sh\n.\/add-cloudflare-ipv4.sh\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"step-4-add-cloudflare-ipv6-to-security-group-using-aws-cli\"><\/span>Step 4: Add Cloudflare IPv6 to Security Group Using AWS CLI<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If your setup supports IPv6, run the following script the same way to allow Cloudflare&#8217;s IPv6 ranges:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# Download Cloudflare IPv6 address ranges\nwget https:\/\/www.cloudflare.com\/ips-v6 -O cloudflare_ips.txt\n\n# Security Group ID\nSG_ID=\"sg-08ea2ffd64093123c\"\n\n# Loop through each IPv6 range and allow ports 80 and 443\nwhile read -r p || &#91;&#91; -n \"$p\" ]]; do\n  aws ec2 authorize-security-group-ingress \\\n    --group-id \"$SG_ID\" \\\n    --ip-permissions \"IpProtocol=tcp,FromPort=80,ToPort=80,Ipv6Ranges=&#91;{CidrIpv6=$p,Description='Cloudflare'}]\"\n\n  aws ec2 authorize-security-group-ingress \\\n    --group-id \"$SG_ID\" \\\n    --ip-permissions \"IpProtocol=tcp,FromPort=443,ToPort=443,Ipv6Ranges=&#91;{CidrIpv6=$p,Description='Cloudflare'}]\"\ndone &lt; cloudflare_ips.txt\n\n# Cleanup\nrm cloudflare_ips.txt\n\necho \"Cloudflare IPv6 IPs have been added to the security group.\"\n<\/code><\/pre>\n\n\n\n<p>Run the same steps: create a <code>.sh<\/code> file in CloudShell, make it executable, and execute it.<\/p>\n\n\n\n<p>This ensures that your EC2 instance accepts traffic only from Cloudflare\u2019s networks, protecting it from direct IP hits.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"step-5-attach-the-security-group-to-your-ec2-instance-and-remove-the-default-one\"><\/span>Step 5: Attach the Security Group to Your EC2 Instance and Remove the Default One<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now that your security group is configured to allow only Cloudflare traffic, it\u2019s time to attach it to your EC2 instance and detach the default security group (which often allows unrestricted access like 0.0.0.0\/0).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"steps-to-attach-the-security-group\"><\/span>Steps to Attach the Security Group:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the <strong>EC2 Dashboard<\/strong> in the AWS Console.<\/li>\n\n\n\n<li>Click on <strong>Instances<\/strong> from the left sidebar.<\/li>\n\n\n\n<li>Select the EC2 instance you want to secure.<\/li>\n\n\n\n<li>In the bottom panel, click on the <strong>Security<\/strong> tab.<\/li>\n\n\n\n<li>Next to \u201cSecurity groups\u201d, click the <strong>edit icon<\/strong>.<\/li>\n\n\n\n<li>In the edit screen:\n<ul class=\"wp-block-list\">\n<li><strong>Remove<\/strong> the default security group (if it allows 0.0.0.0\/0 or wide access).<\/li>\n\n\n\n<li><strong>Add<\/strong> the new security group you created for Cloudflare IPs.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click <strong>Save<\/strong> to apply changes.<\/li>\n<\/ol>\n\n\n\n<p>This way, only Cloudflare\u2019s network can reach your server over HTTP (port 80) and HTTPS (port 443), preventing any direct IP access attempts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-6-verify-that-your-ec2-instance-is-now-protected-from-direct-ip-access\"><span class=\"ez-toc-section\" id=\"step-6-verify-that-your-ec2-instance-is-now-protected-from-direct-ip-access\"><\/span>Step 6: Verify That Your EC2 Instance Is Now Protected from Direct IP Access<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After applying your new security group, it\u2019s essential to verify that everything is working correctly \u2014 meaning your EC2 instance is only accessible through Cloudflare and <strong>not via direct IP<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1-confirm-your-website-loads-via-domain-name\"><\/span>1. Confirm Your Website Loads via Domain Name<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Visit your website through the domain name (e.g., <code>https:\/\/yourdomain.com<\/code>). If everything is set up properly, your site should load normally.<\/p>\n\n\n\n<p>You can also inspect the response headers in your browser&#8217;s developer tools (Network tab). If you see headers like <code>cf-ray<\/code> or <code>server: cloudflare<\/code>, it confirms your site is successfully routed through Cloudflare.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2-try-accessing-directly-via-public-ip-it-should-fail\"><\/span>2. Try Accessing Directly via Public IP (It Should Fail)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now, try entering your EC2 instance\u2019s public IP directly in your browser:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;&lt;your-ec2-ip&gt;<\/code><\/pre>\n\n\n\n<p>You should get a timeout or connection refused message. That\u2019s perfect \u2014 it means your server is no longer accepting direct traffic and is only accessible through Cloudflare.<\/p>\n\n\n\n<p>For more detailed verification, you can run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl http:\/\/&lt;your-ec2-public-ip&gt;<\/code><\/pre>\n\n\n\n<p>And then:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -I https:\/\/yourdomain.com<\/code><\/pre>\n\n\n\n<p>This will show if the response is coming through Cloudflare (look for <code>server: cloudflare<\/code>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3-double-check-security-group-rules\"><\/span>3. Double-Check Security Group Rules<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Go to <strong>EC2 &gt; Security Groups<\/strong>, click on your custom security group, and confirm:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only Cloudflare IPs are listed in the <strong>Inbound rules<\/strong><\/li>\n\n\n\n<li>Ports 80 and 443 are included<\/li>\n\n\n\n<li>No open access like <code>0.0.0.0\/0<\/code> or <code>::\/0<\/code> is present<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%e2%9a%a0%ef%b8%8f-important-note-about-file-uploads-dns-proxy-mode\"><\/span>\u26a0\ufe0f Important Note About File Uploads &amp; DNS Proxy Mode<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Please note: When using Cloudflare with the <strong>proxy mode enabled<\/strong> (orange cloud icon in DNS settings), your website&#8217;s traffic is strictly routed through Cloudflare. That\u2019s the whole point of this setup.<\/p>\n\n\n\n<p>However, there is a <strong>100 MB upload limit<\/strong> on Cloudflare\u2019s proxy.<\/p>\n\n\n\n<p>So if you need to upload files larger than 100 MB (such as large backups or videos), you may face issues \u2014 uploads can fail or timeout.<\/p>\n\n\n\n<p>To handle this, you can temporarily:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Disable Cloudflare proxy for your domain (turn the orange cloud to gray).<\/li>\n\n\n\n<li>Add back the <strong>default security group<\/strong> that allows open access (e.g., 0.0.0.0\/0) just for that time.<\/li>\n\n\n\n<li>Complete the upload.<\/li>\n\n\n\n<li>Re-enable the Cloudflare proxy.<\/li>\n\n\n\n<li>Re-attach the Cloudflare-only security group and remove the open one.<\/li>\n<\/ol>\n\n\n\n<p>This ensures you stay secure and functional, without permanently exposing your EC2 instance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you use Cloudflare to protect your website or application, it acts as a reverse proxy. All user traffic passes through Cloudflare before reaching your AWS EC2 instance. This setup protects your origin server from threats like DDoS attacks, malicious bots, and direct IP scanning. However, if your EC2 instance accepts connections from all IPs, &hellip;<\/p>\n","protected":false},"author":2,"featured_media":13284,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[],"class_list":["post-13279","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Whitelist Cloudflare IPs in AWS Using AWS CLI - SEO Neurons<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Whitelist Cloudflare IPs in AWS Using AWS CLI\" \/>\n<meta property=\"og:description\" content=\"When you use Cloudflare to protect your website or application, it acts as a reverse proxy. All user traffic passes through Cloudflare before reaching your AWS EC2 instance. This setup protects your origin server from threats like DDoS attacks, malicious bots, and direct IP scanning. However, if your EC2 instance accepts connections from all IPs, &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/\" \/>\n<meta property=\"og:site_name\" content=\"SEO Neurons\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SEONeuronsAgency\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/sihmar.ashok\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-02T16:20:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-08T02:53:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/filter-aws-ips-through-cloudflare.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"853\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashok Sihmar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ashoksihmar23\" \/>\n<meta name=\"twitter:site\" content=\"@SEONeurons\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashok Sihmar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/\"},\"author\":{\"name\":\"Ashok Sihmar\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#\\\/schema\\\/person\\\/b9086d09486a6b16c4853ceff88e9912\"},\"headline\":\"How to Whitelist Cloudflare IPs in AWS Using AWS CLI\",\"datePublished\":\"2025-06-02T16:20:46+00:00\",\"dateModified\":\"2025-06-08T02:53:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/\"},\"wordCount\":1353,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/filter-aws-ips-through-cloudflare.jpg\",\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/\",\"url\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/\",\"name\":\"How to Whitelist Cloudflare IPs in AWS Using AWS CLI - SEO Neurons\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/filter-aws-ips-through-cloudflare.jpg\",\"datePublished\":\"2025-06-02T16:20:46+00:00\",\"dateModified\":\"2025-06-08T02:53:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#primaryimage\",\"url\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/filter-aws-ips-through-cloudflare.jpg\",\"contentUrl\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/filter-aws-ips-through-cloudflare.jpg\",\"width\":1280,\"height\":853,\"caption\":\"filter-aws-ips-through-cloudflare\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/allow-only-cloudflares-ip-aws\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/seoneurons.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Whitelist Cloudflare IPs in AWS Using AWS CLI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/\",\"name\":\"SEO Neurons\",\"description\":\"Create, Optimize Website and Drive More Organic Traffic\",\"publisher\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#organization\"},\"alternateName\":\"SEO Neurons\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#organization\",\"name\":\"SEO Neurons\",\"alternateName\":\"SEO Neurons\",\"url\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/seoneurons-logo.svg\",\"contentUrl\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/seoneurons-logo.svg\",\"width\":1,\"height\":1,\"caption\":\"SEO Neurons\"},\"image\":{\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/SEONeuronsAgency\\\/\",\"https:\\\/\\\/x.com\\\/SEONeurons\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/seoneurons\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/SEONeurons\",\"https:\\\/\\\/www.instagram.com\\\/seo_neurons\\\/\",\"https:\\\/\\\/t.me\\\/SEONeurons\"],\"legalName\":\"SEO Neurons\",\"foundingDate\":\"2021-01-21\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1\",\"maxValue\":\"10\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/#\\\/schema\\\/person\\\/b9086d09486a6b16c4853ceff88e9912\",\"name\":\"Ashok Sihmar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/cropped-ashok-2023-96x96.jpg\",\"url\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/cropped-ashok-2023-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/seoneurons.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/cropped-ashok-2023-96x96.jpg\",\"caption\":\"Ashok Sihmar\"},\"description\":\"Ashok Kumar working in the Search Engine Optimization field since 2015. And worked on many successful projects since then. He shares the real-life experience of best SEO practices with his followers on seoneurons.com. You also can learn Advance level SEO for WordPress, Blogger, or any other blogging platform. Stay tuned.\",\"sameAs\":[\"https:\\\/\\\/seoneurons.com\\\/en\\\/author\\\/ashoksihmar\\\/\",\"https:\\\/\\\/www.facebook.com\\\/sihmar.ashok\",\"https:\\\/\\\/www.instagram.com\\\/ashoksihmar23\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ashoksihmar\",\"https:\\\/\\\/x.com\\\/ashoksihmar23\"],\"birthDate\":\"1992-02-11\",\"gender\":\"male\",\"knowsAbout\":[\"SEO\",\"GA4\"],\"knowsLanguage\":[\"English\",\"Hindi\"],\"jobTitle\":\"CEO\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Whitelist Cloudflare IPs in AWS Using AWS CLI - SEO Neurons","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/","og_locale":"en_US","og_type":"article","og_title":"How to Whitelist Cloudflare IPs in AWS Using AWS CLI","og_description":"When you use Cloudflare to protect your website or application, it acts as a reverse proxy. All user traffic passes through Cloudflare before reaching your AWS EC2 instance. This setup protects your origin server from threats like DDoS attacks, malicious bots, and direct IP scanning. However, if your EC2 instance accepts connections from all IPs, &hellip;","og_url":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/","og_site_name":"SEO Neurons","article_publisher":"https:\/\/www.facebook.com\/SEONeuronsAgency\/","article_author":"https:\/\/www.facebook.com\/sihmar.ashok","article_published_time":"2025-06-02T16:20:46+00:00","article_modified_time":"2025-06-08T02:53:39+00:00","og_image":[{"width":1280,"height":853,"url":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/filter-aws-ips-through-cloudflare.jpg","type":"image\/jpeg"}],"author":"Ashok Sihmar","twitter_card":"summary_large_image","twitter_creator":"@ashoksihmar23","twitter_site":"@SEONeurons","twitter_misc":{"Written by":"Ashok Sihmar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#article","isPartOf":{"@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/"},"author":{"name":"Ashok Sihmar","@id":"https:\/\/seoneurons.com\/blog\/#\/schema\/person\/b9086d09486a6b16c4853ceff88e9912"},"headline":"How to Whitelist Cloudflare IPs in AWS Using AWS CLI","datePublished":"2025-06-02T16:20:46+00:00","dateModified":"2025-06-08T02:53:39+00:00","mainEntityOfPage":{"@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/"},"wordCount":1353,"commentCount":1,"publisher":{"@id":"https:\/\/seoneurons.com\/blog\/#organization"},"image":{"@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#primaryimage"},"thumbnailUrl":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/filter-aws-ips-through-cloudflare.jpg","articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/","url":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/","name":"How to Whitelist Cloudflare IPs in AWS Using AWS CLI - SEO Neurons","isPartOf":{"@id":"https:\/\/seoneurons.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#primaryimage"},"image":{"@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#primaryimage"},"thumbnailUrl":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/filter-aws-ips-through-cloudflare.jpg","datePublished":"2025-06-02T16:20:46+00:00","dateModified":"2025-06-08T02:53:39+00:00","breadcrumb":{"@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#primaryimage","url":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/filter-aws-ips-through-cloudflare.jpg","contentUrl":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2025\/06\/filter-aws-ips-through-cloudflare.jpg","width":1280,"height":853,"caption":"filter-aws-ips-through-cloudflare"},{"@type":"BreadcrumbList","@id":"https:\/\/seoneurons.com\/blog\/allow-only-cloudflares-ip-aws\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/seoneurons.com\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/seoneurons.com\/blog\/"},{"@type":"ListItem","position":3,"name":"How to Whitelist Cloudflare IPs in AWS Using AWS CLI"}]},{"@type":"WebSite","@id":"https:\/\/seoneurons.com\/blog\/#website","url":"https:\/\/seoneurons.com\/blog\/","name":"SEO Neurons","description":"Create, Optimize Website and Drive More Organic Traffic","publisher":{"@id":"https:\/\/seoneurons.com\/blog\/#organization"},"alternateName":"SEO Neurons","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/seoneurons.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/seoneurons.com\/blog\/#organization","name":"SEO Neurons","alternateName":"SEO Neurons","url":"https:\/\/seoneurons.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/seoneurons.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2023\/06\/seoneurons-logo.svg","contentUrl":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2023\/06\/seoneurons-logo.svg","width":1,"height":1,"caption":"SEO Neurons"},"image":{"@id":"https:\/\/seoneurons.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SEONeuronsAgency\/","https:\/\/x.com\/SEONeurons","https:\/\/www.linkedin.com\/company\/seoneurons","https:\/\/www.youtube.com\/c\/SEONeurons","https:\/\/www.instagram.com\/seo_neurons\/","https:\/\/t.me\/SEONeurons"],"legalName":"SEO Neurons","foundingDate":"2021-01-21","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1","maxValue":"10"}},{"@type":"Person","@id":"https:\/\/seoneurons.com\/blog\/#\/schema\/person\/b9086d09486a6b16c4853ceff88e9912","name":"Ashok Sihmar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2023\/06\/cropped-ashok-2023-96x96.jpg","url":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2023\/06\/cropped-ashok-2023-96x96.jpg","contentUrl":"https:\/\/seoneurons.com\/blog\/wp-content\/uploads\/2023\/06\/cropped-ashok-2023-96x96.jpg","caption":"Ashok Sihmar"},"description":"Ashok Kumar working in the Search Engine Optimization field since 2015. And worked on many successful projects since then. He shares the real-life experience of best SEO practices with his followers on seoneurons.com. You also can learn Advance level SEO for WordPress, Blogger, or any other blogging platform. Stay tuned.","sameAs":["https:\/\/seoneurons.com\/en\/author\/ashoksihmar\/","https:\/\/www.facebook.com\/sihmar.ashok","https:\/\/www.instagram.com\/ashoksihmar23\/","https:\/\/www.linkedin.com\/in\/ashoksihmar","https:\/\/x.com\/ashoksihmar23"],"birthDate":"1992-02-11","gender":"male","knowsAbout":["SEO","GA4"],"knowsLanguage":["English","Hindi"],"jobTitle":"CEO"}]}},"_links":{"self":[{"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/posts\/13279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/comments?post=13279"}],"version-history":[{"count":0,"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/posts\/13279\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/media\/13284"}],"wp:attachment":[{"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/media?parent=13279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/categories?post=13279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seoneurons.com\/blog\/wp-json\/wp\/v2\/tags?post=13279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}