Re: Basic auth failure monitoring
Ryan Boyd <rbisd <at> rit.edu>
2006-08-02 20:21:07 GMT
Thanks Ryan for the quick response. No, I don't have
the early hook enabled (though I have read the list exchange on the topic)--
unfortunately, I need to have modsecurity at both hooks in the process. I
understand that the 'several hooks' feature is something in
development.
While the 401 method works, I would really like to
consolidate these sorts of alerts in with other alerts in our installation of
the modsecurity console. THowever, I may resort to just doing the email
alerts method as you've discussed.
<response to shameless plug>
Actually, I have read your book pretty much
cover-to-cover. It's a great read -- perhaps I should read that chapter
again though to see if theres anything I've missed.
</response to shameless plug>
Thanks,
-Ryan
---
Ryan Boyd
Web Architect
Information & Technology
Services
Rochester Institute of
Technology
585-475-5573
Did you compile modsecurity with the "-DENABLE_EARLY_HOOK" flag? This
will allow modsecurity to take action much earlier in the request loop.
Details here -
This might allow you to do Attempt #1. This flag is not needed if you
are running Apache/ModSecurity as a reverse proxy, but is needed if it is
embedded.
FYI - I use custom 401 CGI ErrorDocuments to handle these tasks.
Granted keeping a history of auth failures is a bit kludgy as I have to write to
temp files and then quickly read them when another attempt is made. The
scripts will do some counting on past failure attempts and then decide whether
or not to email me.
<Shameless Plug>
</Shameless Plug>
--
Ryan C. Barnett
Web Application Security Consortium (WASC)
Member
CIS Apache Benchmark Project Lead
SANS Instructor, GCIA, GCFA,
GCIH, GSNA, GCUX, GSEC
Author: Preventing Web Attacks with Apache
On 8/2/06, Ryan Boyd
<rbisd <at> rit.edu> wrote:
Hello,
I
would like to be able to monitor authorization failures using
modsecurity
1.9.x and apache 2.2.x
Ideal goal:
If more than x number of auth
failures occur in a given period of time
from the same IP, pass and
log. View auth failures in modsecurity
console.
Realistic
goal:
If an auth failure occurs, pass and log. View auth
failures in
modescurity console and determine problem there based off
reporting.
Attempt 1:
If Authorization header is presented by the
client, but a 401 response
code is returned, pass and log. This
represents a failed login attempt.
Because of where different modules hook
into apache, I believe
mod_authn_basic (using mod_authnz_ldap) is catching
and fully handling
the request before modsecurity is seeing
it. Only if an
authentication/authorization is successful does
modsecurity see the
request.
Attempt 2:
Use custom 401 error
handler to add a 'Auth-Failure' header to response.
Use OUTPUT in
modsecurity to look for that Auth-Failure value and
log,
pass. However, modsecurity can't see the full response of a
401 error
page. If it could and performed certain actions, the
situation exists
where infinite recursion could happen.
Anyone have
any suggestions for handling this? Granted, I could do all
the
handling within the 401 handler, but I would really like these sorts
of
requests to appear in my modsecurity console installation, combined
with
all other 'bad' requests.
Thanks
much,
-Ryan
---
Ryan Boyd
Web Architect
Information
& Technology Services
Rochester Institute of
Technology
585-475-5573
rbisd <at> rit.edu
-------------------------------------------------------------------------
Take
Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's
Techsay panel and you'll get the chance to share your
opinions on IT &
business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
mod-security-users
mailing list
mod-security-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-security-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
mod-security-users mailing list
mod-security-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-security-users