简体   繁体   中英

Blocking Amazon AWS servers from Rails 4 application?

I have a Rails 4 application running on Heroku with exception_notification . I was notified that an AWS server was fishing for a login page by trying to access /wp-login.php . Since that is not my app's login page, someone had to manually enter that URL. Tracking the IP shows an Amazon AWS server in Oregon.

There shouldn't be any reason why someone would ever access my app via an AWS server, so my initial thought is someone is trying to get into the application.

In order to avoid any potential attack, I'm thinking about blocking all Amazon AWS requests.

Is there any way to blacklist Amazon AWS servers specifically? The only thing I can think of is checking the IP address of every request and ignoring those coming from a list I keep of Amazon, but I'm not sure if there is an official listing of Amazon IP addresses.

But checking the IP of every request against a blacklist seems inefficient. I'm aware of the rack-attack gem, but that is still running Ruby code to do the check, which doesn't seem very fast...

Blocking all AWS IPs is not a good solution. Potentially, the traffic can come from any part of the world. How are you going to block the traffic? Instead you should make your application robust.

There is an official listing of AWS IP address: AWS IP Address Ranges

If you are 100% sure that traffic originating from AWS (remember there are many AWS regions), then you can block them using IP tabled. One such solution is: AWS Blocker

Blocking all AWS IPs is not a good solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM