How to block everyone outside of the US.... LightSail Instance

0

How to block everyone outside of the US.... LightSail Instance...

I am trying to find a way to block all IP's outside the US from coming to my LightSail instances....

Can this be done with Route 53? I am trying to stop it before getting to the instance... please keep in mind I am new to this so I dont know to much about this

2 Answers
0

You can use AWS WAF - https://aws.amazon.com/premiumsupport/knowledge-center/waf-allow-block-country-geolocation/

Another option is to use Firewalls on the Lightsail -

1\ https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-editing-firewall-rules#firewall-adding-rules

2\ https://lightsail.aws.amazon.com/ls/docs/en_us/articles/understanding-firewall-and-port-mappings-in-amazon-lightsail

I have tried on mine and it looks like you can add range of IPs to allow/block. Go to the instance, click networking and from there u can add rules (this will allow traffic up to the instance though). By using AWS WAF you can block traffic hitting before

also R53 allows u to do something similar - https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall.html

Niko
answered 2 years ago
  • someone downvoted my answer and that is totally fine but I'd appreciate if you can post why my answer is misleading/wrong so I can learn what I did.

  • I think the thing that is missing here is that in order to use WAF, CloudFront or ALB is required - in this case, I'd recommend CloudFront and geo restrictions rather than WAF - but that is also covered in the first link in your answer.

0

Hi,

Thanks for using Lightsail. If you have a specific IP range that you want to restrict, you can use the instance firewall to restrict access: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-editing-firewall-rules

Regardless, I have taken your request as an item that we will follow up with the team internally.

AWS
MODERATOR
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions