How to block the request from a particular country using WAF

0

I have deployed microservice application on ECS in Mumbai region but my customers are from Sri Lanka how can I block the access to the application from other countries except Sri Lanka, when I set Sri Lanka in the WAF rules its blocking all the services as the inter service communications are originated from Mumbai. How to handle this ?

Eg: I am requesting pricing service from SL and pricing service will communicate the location service. Country for pricing service will be Sri Lanka but for the location service it's India as it communicated by pricing service in Mumbai

질문됨 2달 전173회 조회
2개 답변
2

You can either use WAF Geo Blocking or Cloudfront Geo Blocking if you are using a CDN . In case you dont want to use either of these you can configure your NACLs to block IP address ranges. There is an additional solution using AWS Network Firewall.

(a) If you are taking the Cloudfront approach then please do note CloudFront determines the location of your users by using a third-party database. The accuracy of the mapping between IP addresses and countries varies by Region. Based on recent tests, the overall accuracy is 99.8%. If CloudFront can’t determine a user’s location, CloudFront serves the content that the user has requested. There are no charges for Cloudfronts Geo-Blocking.

(b) If you are using the WAF solution you will need to consider a whitelisting approach as mentioned in the knowledge based article "https://repost.aws/knowledge-center/waf-allow-block-country-geolocation"

(c) In case of NACLs you will need to customize your solution and will need some effort to aggregate different subnet ranges. Please also note the NACL limitations while designing a NACL based solution https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-nacls .

(d) You can consider AWS Network Firewall with Amazon GuardDuty to implement Geo-Blocking as well https://aws.amazon.com/blogs/security/automatically-block-suspicious-traffic-with-aws-network-firewall-and-amazon-guardduty/

The below blogs and articles should be of additional help

https://aws.amazon.com/blogs/security/how-to-use-granular-geographic-match-rules-with-aws-waf/

https://aws.amazon.com/blogs/networking-and-content-delivery/geo-block-content-using-amazon-location-and-edge-services/

https://aws.amazon.com/developer/application-security-performance/articles/geo-blocking/

profile pictureAWS
Avinash
답변함 2달 전
profile picture
전문가
검토됨 2달 전
0

I hope the below URL will help you.

How do I allow or block requests from a specific country or geolocation using AWS WAF? https://repost.aws/knowledge-center/waf-allow-block-country-geolocation

AWS
전문가
hyp
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠