How to Block IP Addresses on Heroku

Why would you need to block an IP address

Many poorly written, misbehaving, or malicious bots can be readily identified as generating traffic from a single IP address.

Blocking an IP is typically the first step to take in rejecting unwanted traffic hitting your site.

Prerequisites

What you need to get started:

  1. Expedited WAF add-on is setup in front of your application.

How to Block IP Addresses on Heroku

From the Block/Allow IPs page of your Expedited WAF dashboard, add each IP or CIDR-notated IP range that you want to block:

All requests from that IP/range will be stopped at the WAF and will not reach your Heroku application.

Notes

  • To prevent accidentally blocking large portions of the Internet from reaching your site, block the narrowest effective IP range.
  • In most cases you’ll need to layer in additional filtering rules in addition to blocking a single IP/range.

IP Resources

Learn more about IP addressing

Next steps

If you need help with improving your application's security, you can Book a Demo (free) to talk to a security engineer about your application security and compliance requirements. If you're ready to go, you can add the Expedited WAF add-on to your Heroku application in about 15 minutes.