[OpenSIPS-Users] Log authentication errors

Joan aseques at gmail.com
Fri Aug 27 17:24:54 CEST 2010


Hello,

Since some time ago there are plenty of hackers trying to stole
accounts and bruteforcing passwords. I would like to log all the
wrong authentications so I can use fail2ban to block those ips.
I've been reading all the mailing list history and I don't see
anything related althought is quite interesting.
I've been trying something and at the moment the best I could do is this:

        if (is_method("REGISTER")) {
                # authenticate the REGISTER requests
                if (!www_authorize("", "subscriber")) {
                        xlog("L_ERR","Auth error for $fU@$fd from $si");
                        www_challenge("", "0");
                        exit;
                }


So when the device tries to register with a wrong password/username i
will log  the errors. After that I still have to do the fail2ban
script, but that's quite easy.
I'd like to know your opinion about this.

Thanks



More information about the Users mailing list