I have a rails app on heroku, and there are about 10 requests per second, which is strange because no one is using the app right now. All of the requests are for URI's that are clearly attempting to exploit security vulnerabilities, for example.
http://myapp.com/etc/passwd
and things like that.
How can I block this person from accessing my app? Is there a quick fix for this?
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.
Heroku's QuotaGuard Static IP solution routes your traffic through a pair of static IP addresses that never change. It should be used if you need your traffic to pass through a known IP address for the purpose of firewall ingress rules or application whitelisting with a third party.
Perhaps rack-attack will do what you want?
# Block requests from 1.2.3.4
Rack::Attack.blacklist('block 1.2.3.4') do |req|
# Request are blocked if the return value is truthy
'1.2.3.4' == req.ip
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With