Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block IPs on heroku

Tags:

heroku

I haven't found this any where in heroku's documentation or on google. Typically this is done in the host file. Does anyone have any idea how to block an ip on heroku?

like image 593
CrazyCoderMonkey Avatar asked Aug 29 '12 19:08

CrazyCoderMonkey


2 Answers

Since this was first answered, Heroku has added a Web Application Firewall in their AddOn Marketplace: https://elements.heroku.com/addons/expeditedwaf

It can block inbound requests by IP, UserAgent, Referrer, Country, etc.

like image 84
Mike Buckbee Avatar answered Nov 12 '22 16:11

Mike Buckbee


Heroku doesn't have a firewall that you can use to block IPs, so you would have to either block it at the application level, or you would have to put a proxy of some sort in front of your application that you can use to block the IP. One common one people use is CloudFlare, which has support for blocking individual IPs, rate limiting IPs, etc.

If you want to stick with blocking at the application level, and are using Ruby on Rails, this question and answer which might give you what you're looking for: How can you block or filter IP addresses on Heroku?

like image 9
Taytay Avatar answered Nov 12 '22 15:11

Taytay