Difference between revisions of "Mod evasive"

From Atomicorp Wiki
Jump to: navigation, search
m (Overview)
m (Troubleshooting)
Line 7: Line 7:
 
<nowiki>[file "mod_evasive20.c"] [line 246] [level 3] client denied by server configuration:</nowiki>
 
<nowiki>[file "mod_evasive20.c"] [line 246] [level 3] client denied by server configuration:</nowiki>
  
This message indicates the threshold has been exceeded. There are two solutions, in order of more secure to less secure.
+
This message indicates the threshold has been exceeded. There are two solutions, in order of most secure to least secure.
  
 
'''Solution 1:  Increase the thresholds for mod_evasive to be less sensitive to connections.'''
 
'''Solution 1:  Increase the thresholds for mod_evasive to be less sensitive to connections.'''
Line 64: Line 64:
 
   asl -s -f
 
   asl -s -f
  
 +
'''Solution 2:  Whitelist the IPs'''
  
'''Solution 2:  Disable mod_evasive entirely:'''
+
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.*
 +
 
 +
 
 +
'''Solution 3:  Disable mod_evasive entirely:'''
  
  
Line 83: Line 90:
  
 
   asl -s -f
 
   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.*
 

Revision as of 10:02, 11 February 2011

Overview

Mod_evasive is the Web Denial of Service module used in ASL. It is designed to throttle http and https 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 most secure to least 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: 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.*


Solution 3: 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
Personal tools