Question

For some reason, a script of some sort makes a repeated request to my site every second or faster to a URL that doesn't exist. It's painful because it clogs up the logs (and is an unnecessary (although small) consumption of resources). Just wondering if there's a good way to deal with this for a site hosted on Heroku. The requests come from a different IP address each time.

Edit: As a note, the requests are always to the exact same URL.

Here's an example, which repeats every second or so, except from a different IP:

Feb 22 08:37:28 myApp app/web.1: ActionController::RoutingError (Not Found):
Feb 22 08:37:28 myApp app/web.1:   app/controllers/application_controller.rb:31:in `not_found'
Feb 22 08:37:28 myApp app/web.1:   app/controllers/my_controller.rb:141:in `my_method'
Feb 22 08:37:28 myApp app/web.1: [Exceptiontrap] Raised Exceptiontrap::Rack::Exception
Feb 22 08:37:28 myApp app/web.1: [Exceptiontrap] Catched Exception: ActionController::RoutingError
Feb 22 08:37:28 myApp app/web.1: Started GET "/aSpecificURL" for 109.242.56.44 at 2014-02-22 13:37:28 +0000
Feb 22 08:37:28 myApp heroku/router: at=info method=GET path=/aSpecificURL host=www.myApp.com request_id=9caeabcf-adcc-417f-940d-0458a81d9c32 fwd="109.242.56.44" dyno=web.1 connect=2ms service=24ms status=404 bytes=1632
Was it helpful?

Solution

You can't block specific requests through heroku. It sounds to me like someone is scanning your app for security vulnerabilities.

You could setup cloudflare to help block some of the requests. But overall, this is pretty common and not something to worry about.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top