How to defend against attacks resulting in large volumes of 404 or other 4xx HTTP error codes with Fail2Ban
Our websites are constantly under attack from the outside world. The vast majority of these are done by robots, which try to discover the weak points of the websites running on the server. Some of the robots with this purpose try to do this by making various seemingly random HTTP requests to our websites, most of which are directed to non-existent URL addresses. As a result, our server responds with a 404 HTTP response code. In this description, we will look at how to ban the large number of attempts resulting in 404 and other 4xx HTTP response codes using Fail2Ban.