Difference between revisions of "Mod evasive"

From Atomicorp Wiki
Jump to: navigation, search
m
Line 85: Line 85:
 
   asl -s -f
 
   asl -s -f
  
== whitelisting IPs ==
+
'''Solution 3:  Whitelist the IPs'''
  
 
You can exclude IPs from the DOS protection.  To do that, simply edit /etc/httpd/conf.d/mod_evasive.conf and add the directive DOSWhitelist with the IPs or ranges you want to exclude.  Wildcards can be used on up to the last 3 octets if necessary.  Multiple DOSWhitelist commands may be used in the configuration.  For example:
 
You can exclude IPs from the DOS protection.  To do that, simply edit /etc/httpd/conf.d/mod_evasive.conf and add the directive DOSWhitelist with the IPs or ranges you want to exclude.  Wildcards can be used on up to the last 3 octets if necessary.  Multiple DOSWhitelist commands may be used in the configuration.  For example:

Revision as of 18:17, 4 October 2010

Overview

Mod_evasive is the Denial of Service module used in [ASL]. It is designed to throttle connections when they reach above a specified threshold.


Troubleshooting

[file "mod_evasive20.c"] [line 246] [level 3] client denied by server configuration:

This message indicates the threshold has been exceeded. There are two solutions, in order of more secure to less secure.

Solution 1: Increase the thresholds for mod_evasive to be less sensitive to connections.

Step 1) Log into the ASL GUI and Select Configure ASL, or edit /etc/asl/config

 vim /etc/asl/config

Step 2) Increase the thresholds in the following fields

 MODEV_DOSPageCount="12"
 MODEV_DOSSiteCount="400"
 MODEV_DOSPageInterval="2"
 MODEV_DOSSiteInterval="2"

NOTE: These vary depending on the environment, we start by doubling the values, and then backing them off.


MODEV_DOSPageCount="12"

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


MODEV_DOSSiteCount="400"

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


MODEV_DOSPageInterval="2"

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


MODEV_DOSSiteInterval="2"

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


MODEV_DOSBlockingPeriod="20"

The blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list. During this time, all subsequent requests from the client will result in a 403 (Forbidden) and the timer being reset (e.g. another 10 seconds). Since the timer is reset for every subsequent request, it is not necessary to have a long blocking period; in the event of a DoS attack, this timer will keep getting reset.


Step 3) Update the security policy by running the following command as root:

 asl -s -f


Solution 2: Disable mod_evasive entirely:


Step 1) To disable mod_dosevasive just change this setting in the GUI:

From:

MODEV_ENABLED="yes"

To:

MODEV_ENABLED="no"

Or edit /etc/asl/config.

Step 2) Update the security policy by running the following command as root:

 asl -s -f

Solution 3: Whitelist the IPs

You can exclude IPs from the DOS protection. To do that, simply edit /etc/httpd/conf.d/mod_evasive.conf and add the directive DOSWhitelist with the IPs or ranges you want to exclude. Wildcards can be used on up to the last 3 octets if necessary. Multiple DOSWhitelist commands may be used in the configuration. For example:

 DOSWhitelist   127.0.0.1
 DOSWhitelist   192.168.0.*
Personal tools