Repository navigation
Replies: 6 comments
|
up.. |
0 replies
|
in your fail2ban.filter code, check for the throttle key in |
0 replies
|
@courtenay I like your suggestion, but in this case we should set maxretry to 0 in the Fail2Ban filter, right? |
0 replies
|
Solved with using |
0 replies
|
@kruglyjmax using |
0 replies
|
I solved my issue by adding a method to def exceeded?(request)
discriminator = discriminator_for(request)
return false unless discriminator
current_period = period_for(request)
current_limit = limit_for(request)
key = [Time.now.to_i / current_period, name, discriminator].join(':')
count = cache.read(key).to_i
count > current_limit
endAnd then I can use: Rack::Attack::Fail2Ban.filter("throttled/#{req.ip}", maxretry: 10, findtime: 1.minute, bantime: 1.hour) do
configuration.throttles.any? { |_name, throttle| throttle.exceeded?(req) }
end |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I want to first throttle abusers but then if they continue issue a ban, I am not being successful as everything is getting "forbidden"
All reactions