4

Does anyone know how to detect and ban the IP address or addresses automatically from which a lot of requests come in a very short period of time?

Example: someone has made a script to execute different special characters on an index page to try to slow or shut down the website:

https://website.com?name=23343jvugij
https://website.com?name=%ç*3233
https://website.com?name=SELECT_*"ç221
https://website.com?name=23+*+~33¬¬
https://website.com?name=&&%*ç"exit
https://website.com?name=count(*)#@|@

And the user keeps executing it, let's say 100 requests per minute. Is there a way to detect this and ban the users IP address immediately in Spring Boot?

Dario Sagud
  • 81
  • 1
  • 8

1 Answers1

4

There are many ways to do it, but I suggest to go for https://github.com/MarcGiffing/bucket4j-spring-boot-starter

It has an option to limit the rate based on remote IP address.

Yogesh Prajapati
  • 4,770
  • 2
  • 36
  • 77