|
|
|
|
|
by tyingq
3698 days ago
|
|
Thinking on this some more, this story makes even less sense. He first mentions having to change Apache to recognize X-Forwarded-For, because there is Amazon Elastic Load Balancing between his site and the internet. This means, of course, that the "attacking ips" aren't making direct connections to his EC2 instance. They are proxied connections, all from the internal ELB service. So later, when he mentions trying to use iptables to block traffic...that just doesn't make sense. There are no connections from those ips to the EC2 instance. You could use .htaccess rules, since Apache is aware of X-Forwarded-For. Lastly...why would you put an elastic load balancer in front of a single web server? |
|
This blog posts explains the whole thing: https://centos.tips/fail2ban-behind-a-proxyload-balancer/
I have no idea if using .htaccess rules would be better than this solution, I just know that this one works.