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

feita há um mês173 visualizações
2 Respostas
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
respondido há um mês
profile picture
ESPECIALISTA
avaliado há um mês
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
ESPECIALISTA
hyp
respondido há um mês
profile picture
ESPECIALISTA
avaliado há um mês

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas