You are on page 1of 2

Rack:Attack | Gem requirement

Fit

rack/rack-attack
Note: You are viewing the development version README. For
the README consistent with the latest released version see
https://github.com/kickstarter/rack-attack/blob/6
https://github.com/rack/rack-attack

 particular session - no.of requests/second greater than 1000 (eg) - block


that session for that 1 second - Next second onwards serve data as usual
Possible using Allow2Ban feature in this gem

rack/rack-attack
Note: You are viewing the development version README.
For the README consistent with the latest released
version see https://github.com/kickstarter/rack-
https://github.com/rack/rack-attack/blob/6-stable/RE
ADME.md#allow2ban

 Happens for 10 mins / frequently - Like for each second, 1000 req etc.
then check for anomaly → I am not sure how to do this via code.. need
guidance but I think it can be done.

reduce no.of.requests/second possibly later on and raise alert via


email etc.
Can raise email inside using Fail2Ban. I don't know how the whole
thing fits in together.. need help with that.

 Ip level restriction - from ip - no.of.requests/second (if session is not there)


There is ip level restriction and we can blocklist/safelist ip addresses too

 Store these as logs somewhere. blocked ips, sessions - store somewhere.


Yes.
There is logging possible. You can subscribe to  rack_attack  events and
log it, graph it, etc. To get notified about specific type of events,
subscribe to the event name followed by the  rack_attack  namesapce

Rack:Attack | Gem requirement Fit 1


rack/rack-attack
Note: You are viewing the development version README.
For the README consistent with the latest released
version see https://github.com/kickstarter/rack-
https://github.com/rack/rack-attack/blob/6-stable/RE
ADME.md#logging--instrumentation

 initially send mail alerts - if request increases/count increases.


Yup possible. But Rack::Attack uses the ActiveSupport::Notifications API if
available. So we need to use a 3rd party email caller. Can use the same
one we have been using already.

Rack:Attack | Gem requirement Fit 2

You might also like