mod_evasive 会不会过于激进而扼杀良好的流量?

Can mod_evasive be too aggressive and kill off good traffic?

我的站点遭到 DDoS 攻击,托管公司的管理员向我的服务器应用了 mod_evasive。我的流量从每天 10K+ 次访问增加到每天 1K-2K 次。 mod_evasive 是否可以过于激进并扼杀良好的流量?

可以,但取决于配置。您必须确保它已正确配置。有四种主要设置:

DOSPageCount
This is the threshold for the number of requests for the same page (or URI) per page interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list.

DOSSiteCount
This is the threshold for the total number of requests for any object by the same client on the same listener per site interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list.

DOSPageInterval
The interval for the page count threshold; defaults to 1 second intervals.

DOSSiteInterval
The interval for the site count threshold; defaults to 1 second intervals.

最初在我们的服务器上使用它时,我们遇到了与您相同的问题,然后我们检查了日志和访问者 activity 并进行了设置,现在我们可以说它运行良好。

要防止 DDOS,您可以使用有效的 cloudflare、ns1 或 capsula 服务。 Fail2Ban 以及 CSF 和 mod 安全性将增加更多保护。

但是无论你设置什么,你都必须分析你的访问者activity否则你最终会阻止真正的访问者。