Throttling Solution For Shared IP Addresses #529
Replies: 3 comments 3 replies
-
I saw a few posts suggesting the following, would this work for my case?
|
Beta Was this translation helpful? Give feedback.
-
So I got bit by this when implementing rack-attack - I actually think it's a pretty major problem considering this has rails connections but rack obviously doesn't have the rails nice request.remote_ip to handle this, so 99% of rails people are going to have this problem. One problem with the solution above though is that HTTP_X_FORWARDED_FOR can be a comma split string if there's more than one proxy server? But that makes this a lot more complicated realip = request.env['HTTP_X_FORWARDED_FOR'].split(',').first if request.env['HTTP_X_FORWARDED_FOR']&.is_a?(String) |
Beta Was this translation helpful? Give feedback.
-
It probably didn't work because you didn't tell Rack what your trusted upstream proxies are. It's not "junk" to prevent untrusted proxies from lying to your service about what IP address they're coming from, because that way lies trivial DoS attacks. |
Beta Was this translation helpful? Give feedback.
-
I was trying to throttle logins by IP as such, however ran into an issue with some organizations sharing IP addresses.
Is there a solution or best practise for organizations using shared IP addresses? For example a school's computer lab where all terminals use the same public IP?
Beta Was this translation helpful? Give feedback.
All reactions