Log IP's with failed route request, NGINX/Rails

Viewed 18

Hello I have an NGINX web server with a few rails applications running on it. A lot of different bots are requesting exploit URL's and trying XSS etc. How can I log each IP, MAC address, number of request from this IP etc and ban these IP's if the wbe request gives the following errors:

ActionController::RoutingError (No route matches [GET] "/wp-login.php"):

If possible I would also like to keep a tally of which urls are being requested most frequently. Thanks for helping out! Any other security recommendation would be welcome!

0 Answers
Related