🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rocksolid.nodes
Article #283

Re: ddos defense for novabbs.com

#283
From: Retro Guy Retro Guy
Date: Fri, 22 May 2020 08:32
19 lines
2572 bytes
anonymous wrote:

> care to describe what you did exactly ? and on which level of the stack ?

Most of what I was seeing was more than just rudely configured spiders (which tend to go through a site at a high rate of speed). I was seeing the same pages being requested very fast, over and over again from the same ip addresses. Since the addresses would be the same for a while, then completely new addresses, just blocking them would not work.

For tor this doesn't work, but for i2p (on the same machine) and clearnet, I've had great results with the nginx Limit Req Module http://nginx.org/en/docs/http/ngx_http_limit_req_module.html

From the site:
The ngx_http_limit_req_module module (0.7.21) is used to limit the request processing rate per a defined key, in particular, the processing rate of requests coming from a single IP address. If the requests rate exceeds the rate configured for a zone, their processing is delayed such that requests are processed at a defined rate. Excessive requests are delayed until their number exceeds the maximum burst size in which case the request is terminated with an error.
-------------

This does not protect against many types of attacks, but for just trying to shut the site down by overloading it, it's working very well. I've tied in the ip address logs to fail2ban to temporarily ban the offending ip addresses. Since setting this up, I have not needed to restart php-fpm or nginx a single time.

Retro Guy

-- 
Posted on: Rocksolid Light
news.novabbs.com
Technical Details
Message-ID: <715287e8bd4cc83e628a4e69ce6bd304$1@news.novabbs.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!.POSTED!not-for-mail
References: <733615c1436ceffa04cd2d7eb3ec2546$1@news.novabbs.com> <f0ba1870346ce5f36eb9365850311bf7$1@z5bqfv5v75kxy7pj.onion>

Show Full Headers
Complete Article Headers
Message-ID: <715287e8bd4cc83e628a4e69ce6bd304$1@news.novabbs.com>
Subject: Re: ddos defense for novabbs.com
Date: Fri, 22 May 2020 08:32:00 +0000
From: Retro Guy@rslight.i2p (Retro Guy)
References: <733615c1436ceffa04cd2d7eb3ec2546$1@news.novabbs.com> <f0ba1870346ce5f36eb9365850311bf7$1@z5bqfv5v75kxy7pj.onion>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!.POSTED!not-for-mail
Newsgroups: rocksolid.nodes
Organization: Rocksolid Light
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org; posting-account="retrobbs1";
 logging-data="27533"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.com
X-Rslight-Site: $2y$10$H6E6SroRIBJvkWYqTb4oAOUiMDwMZyGltl9WGs0Bc4VF.LqoUvZGe