Re: How to stop dropped requests to be passed to Apache
Brian Rectanus <Brian.Rectanus <at> breach.com>
2008-12-01 04:10:44 GMT
R.A. Imhoff wrote:
> Hello,
>
> I noticed that requests intercepted by the following rule still show
> up in the Apache access log:
>
> >SecRule REQUEST_URI "@pm http korff .dll db_config" "phase:
> 1,t:none,drop,status:400,exec:/sbin/blacklist_web,msg:'proxy url 1 -
> blacklisted',severity:'2',id:'111022',tag:'blacklisted'"
>
>
> I had thought with the "drop" action the request would not be passed
> on at all ?
>
> The way it is now, the offending IP does get blacklisted, but the
> initial request that triggered this rule got through to Apache inspite
> of the "drop".
>
> Am I using the wrong phase, or how to avoid Apache getting such
> requests at all ?
> (Also, the "drop" causes the client's browser to re-attempt the same
> request, which gets to the server before the blacklist script
> finished, so there are actually two almost simultaneous identical
> requests in the ModSec log.)
The "drop" action closes the socket between client and server (sends a
TCP FIN/ACK) and does not use the "status:400" as you would get with a
"deny". The "drop" really should not be retried by the browser (what
browser?), so I suspect that this is not working correctly (but it may
view the "drop" the same as a failed KeepAlive request and retry). Some
items to check:
1) The "drop" action does not work correctly on a Windows webserver and
should become a "deny". Check the debug and error logs.
2) The "drop" action will not work when SecRuleEngine is set to
"DetectionOnly".
3) Check the Apache error log to see if there is a message stating it
was dropped.
4) In the access log, are the requests getting through successfully?
Please provide the relevant access, error and ModSec debug log entries
(sanitize them).
thanks,
-B
--
--
Brian Rectanus
Breach Security
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/