1

I am aware that we can set Lambda authorizer when reaching an API Gateway endpoint. I am also aware that we can set a policy that would allow to block some IP addresses (inside a list) for example.

I would like to build a system that would detect an abnormal number of calls to the same lambda by the same IP address and block this IP address because of this bad behavior.

How can i do this kind of logic / check from the lambda or the API Gateway automatically ?

Note : i am running my lambdas under python 3.9

Edit : I am using HTTP API Gateway and this seems to not be supported at the moment...

Tom3652
  • 2,540
  • 3
  • 19
  • 45
  • 2
    Related: [AWS API Gateway: limit requests from a single IP](https://stackoverflow.com/questions/38444923/aws-api-gateway-limit-requests-from-a-single-ip). – jarmod Sep 23 '22 at 14:21
  • Thanks for the ref it looks like the thing i need at the end, but i was looking for a way to do it from the python using AWS APIs. – Tom3652 Oct 05 '22 at 13:49
  • 1
    You can automate the creation of WAF, IP rule sets, integration with API Gateway etc. using CloudFormation or any other IaC mechanism. – jarmod Oct 05 '22 at 14:21
  • Hi guys thanks but this doesn't help unfortunately since i am using HTTP API in API Gateway and WAF doesn't support this. I would like to avoid paying CloudFront that i don't need only to be able to setup WAF... – Tom3652 Oct 08 '22 at 13:28

0 Answers0