Live data from Hacker News

Rack Attack: Protection from abusive clients

kickstarter.com

11–20 of 28 posts

Re: Rack Attack: Protection from abusive clients

#11
Maybe I'm missing something, but this seem like something that would only be useful in situations where you don't have access to anything "closer" to the network requests (router, firewall, webserver) that you can tweak to handle these types of things.

So it's something that's good for Heroku apps?

Re: Rack Attack: Protection from abusive clients

#12
post #9

This seems like a vulnerability in their implementation: "configure your proxy to set the X-Forwarded-For header with the source IP"

That's pretty common practice so you don't get the IP of the machine your web server is on passed to the app instead of the user's ip.

Re: Rack Attack: Protection from abusive clients

#13
post #8

Nice. I was really hoping it protected me from a very different kind of "abusive client" though. I guess there are somethings that even in ruby you can't do easily.

My wallet nearly hit me in the face such was its velocity upon breach of my pocket.

Sounds like you need protection from your own wallet!

Re: Rack Attack: Protection from abusive clients

#14
post #8

Nice. I was really hoping it protected me from a very different kind of "abusive client" though. I guess there are somethings that even in ruby you can't do easily.

My wallet nearly hit me in the face such was its velocity upon breach of my pocket.

Yeah, double confusing. After realizing it wasn't that kind of client it still took me a bit to realize it wasn't a fundraiser, either.

Re: Rack Attack: Protection from abusive clients

#15

Maybe I'm missing something, but this seem like something that would only be useful in situations where you don't have access to anything "closer" to the network requests (router, firewall, webserver) that you can tweak to handle these types of things. So it's something that's good for Heroku apps?

Probably.

It's a good way when you don't have privilege access to the server OR skills to do it manually on Nginx etc.

Re: Rack Attack: Protection from abusive clients

#16
post #10
post #5

Earlier quoted context omitted.

| blocking ports where there are no services doesn't | do much True, but it can be a useful 'just in-case' against things listening on ports that you were unaware of. It's obviously bad for you not to know about services that are listening on your box, but you could view it as a safety net.

Agree, I also block all unused incoming ports as a safety net as you say.

Probably easier to just use a whitelist policy, no?

Re: Rack Attack: Protection from abusive clients

#17

Maybe I'm missing something, but this seem like something that would only be useful in situations where you don't have access to anything "closer" to the network requests (router, firewall, webserver) that you can tweak to handle these types of things. So it's something that's good for Heroku apps?

It allows whitelisting... based on arbitrary properties of the request.

So if your user authentication code was also a Rack middleware, and you inserted Rack::Attack after it in the middleware stack, you could rate limit based on user account as well as IP address. That would be harder to do at the firewall or web server level.

This isn't for preventing DOS attacks (for which you'd want to completely avoid hitting application code), it's just for preventing unauthorised or excessive usage.

Re: Rack Attack: Protection from abusive clients

#18
post #3

Nice. I was really hoping it protected me from a very different kind of "abusive client" though. I guess there are somethings that even in ruby you can't do easily.

Haha I also saw the kickstarter.com domain and thought: "tell me more about this!" probably thinking the same as you..

Imagine my dismay when I clicked through and read, "Oh, a web request client".

Re: Rack Attack: Protection from abusive clients

#19

Maybe I'm missing something, but this seem like something that would only be useful in situations where you don't have access to anything "closer" to the network requests (router, firewall, webserver) that you can tweak to handle these types of things. So it's something that's good for Heroku apps?

Most times your firewall and router aren't doing layer 7/application level inspection/actioning. If Rack::Attack can handle it efficiently, its the easy way to go.

Re: Rack Attack: Protection from abusive clients

#20

Maybe I'm missing something, but this seem like something that would only be useful in situations where you don't have access to anything "closer" to the network requests (router, firewall, webserver) that you can tweak to handle these types of things. So it's something that's good for Heroku apps?

Think of it as defense-in-depth. This allows higher-level, but more sophisticated rules, while your lower layers provide simpler but lower overhead filtering. Hopefully abusive requests never reach this thanks to your router / firewall / web server rules, but if they do, this will help keep things in check.
Post reply on HN