How can I block certain ips and redirect them to a custom page using symfony 3.4

  ip, symfony, symfony-3.4

I have a system running on symfony 3.4. Recently I get a lot of requests testing a list of urls like the following:


They are coming from the same ip address, using python:

User-agent: python-requests/2.9.1

My guess is that someone is trying the system to find access points to known vulnerabilities.
Now my solution to this problem would be to block that ip address from accessing any files on my server.

  1. Is that a good idea / solution?
  2. Does anyone have similar problems and knows a better solution / how to get rid of these calls?
  3. How can I implement an ip blocking in symfony 3.4?

Source: Symfony Questions