store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Sun May 19, 2013 6:15 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 8 posts ] 
Author Message
 Post subject: apache keepalive + mod evasive
Unread postPosted: Mon Nov 07, 2011 11:23 pm 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 348
Hello guys.

I enabled keep alive in apache. I show that google page speed gave twice the grade just with keep alive enabled for most sites !

After a while though I got banned because mod evassive thought I was dos attacking the server.

Any ideas ? Any reason not to enable keep alive ?

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Tue Nov 08, 2011 6:08 am 
Offline
Forum Regular
Forum Regular

Joined: Wed Jan 02, 2008 3:21 pm
Posts: 515
Location: United Kingdom
That's interesting, also enabled Keep-Alive recently to evaluate PageSpeed suggestions and noticed mod_evasive blacklisting address as source of possible DoS attack (never seen this rule triggered before). Investigated IP's involved and they are mostly spiders/crawlers hitting multiple pages in quick succession. Have read pro's/con's on enabling keep-alive but it seems to make a slight difference to load times (far expiring headers and optimisation at sources does more), but with page speed being one of Google/Yahoo's criteria in ranking, these options have to be investigated.

Anyone else enabled keep-alive?


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Mon May 21, 2012 1:08 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1843
Very old post but just done so today (after many years with it off).

I'm suddenly getting mod_evasive going a bit nuts :-( I've upped the limits on it but still getting quite a number of IPs (including totally legis, non-crawler ones) blocked. May have to turn it off.

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Mon May 21, 2012 7:51 pm 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 348
faris wrote:
Very old post but just done so today (after many years with it off).

I'm suddenly getting mod_evasive going a bit nuts :-( I've upped the limits on it but still getting quite a number of IPs (including totally legis, non-crawler ones) blocked. May have to turn it off.


Ι never managed to make it work back then. To be honest I don't even remember what I tried back then. Hope the ASL guys have some suggestion on that. It seemed that sites were actually loading much faster indeed ! Offcourse I don't know how big this is as a potential security risk when defending against DDOS.

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Tue May 22, 2012 5:39 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1843
Realistically, mod_evasive isn't going to prevent a real DDoS.

It will prevent a badly behaved scraper/spider from potentially bringing apache to its knees, however. It might even help prevent the kind of issue that got be banned from Google AdSense, where an unknown third-party goes nuts following all links and Google decides you are a bad guy.

Because of this, I think it is useful to have it.

Incidentally, I note that when mod_evasive triggers, the ossec rule is level 6 or 7, and typically won't be seen by the admin. In addition, the mod_evasive config file isn't changed by ASL to have an email sent when it triggers.

One of the things I did was to change the rule to level 12 so that I get clear email alerts when it triggers.

p.s., from the README. My keepalive timeout was very low - 15s.

Code:
  340 TWEAKING APACHE
  341
  342 The keep-alive settings for your children should be reasonable enough to
  343 keep each child up long enough to resist a DOS attack (or at least part of
  344 one).  Remember, it is the child processes that maintain their own internal
  345 IP address tables, and so when one exits, so does all of the IP information it
  346 had. For every child that exits, another 5-10 copies of the page may get
  347 through before putting the attacker back into '403 Land'.  With this said,
  348 you should have a very high MaxRequestsPerChild, but not unlimited as this
  349 will prevent cleanup.
  350
  351 You'll want to have a MaxRequestsPerChild set to a non-zero value, as
  352 DosEvasive cleans up its internal hashes only on exit.  The default
  353 MaxRequestsPerChild is usually 10000.  This should suffice in only allowing
  354 a few requests per 10000 per child through in the event of an attack (although
  355 if you use DOSSystemCommand to firewall the IP address, a hole will no
  356 longer be open in between child cycles).

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Tue May 22, 2012 5:54 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1843
Hmmmm... mod_qos looks rather tasty and possibly would work wonderfully with mod_evasive.

http://opensource.adnovum.ch/mod_qos/

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Tue May 22, 2012 2:11 pm 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 348
mod evasive wont do any good in case of a ddos that for sure. You need an outstanding router over there to handle the mess. And linux won't make it. Only PF can handle very very very bad situations.

But as far as I have tried mod evasive, it doesnt even get simple dos attacks from a tool even a kid might use loic. And the problem is with all the vdsl's in the world and all the people trying to become a "windows" hacker you need to take actions to prevent this kind of abuse.

I have setup my router to catch these nasty guys and blacklist them for 10 minutes to 60, depending on the case of abuse.
I have managed to fine tune it to the point that normal users that even swap very fast between pages with 3-4 people in their office don't experience any issues, while the bad guys even if they set loic to slow with a few threads after 10 seconds the abuser will eventually get banned.

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: apache keepalive + mod evasive
Unread postPosted: Tue May 22, 2012 4:53 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3242
Location: Chantilly, VA
mod evasive is only designed to stop DOS attacks, not DDOS attacks.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 8 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group