hey guys.
I was trying to add the htable routing rules here:
http://preview.tinyurl.com/nomqsls
but I need some help figuring our where they should go. See, I really like how this guy bans users for 15 minutes for failing to auth 3 times in a row. Where and how should I add this to my kam config?
Any help would be greatly appreciated.
Thanks
I typically put that block of code in a specific routing block, and based on the default config, I put it right in the AUTH block:
route[AUTH] { #!ifdef WITH_AUTH
#!ifdef WITH_IPAUTH if((!is_method("REGISTER")) && allow_source_address()) { # source IP allowed return; } #!endif if (is_method("REGISTER") || (from_uri==myself || from_uri=='79.125.19.254')) {
#!ifdef WITH_AUTH_COUNT route(COUNT_AUTH)
….
route[COUNT_AUTH] {
if(is_present_hf("Authorization")) { if($sht(a=>$au::auth_count)==3)
{
$var (exp) = $Ts - 900;
…
Grtz, Davy
Op 30-jan.-2014, om 04:10 heeft Salvatore Nuzzo sn@IDS.GS het volgende geschreven:
hey guys.
I was trying to add the htable routing rules here:
http://preview.tinyurl.com/nomqsls
but I need some help figuring our where they should go. See, I really like how this guy bans users for 15 minutes for failing to auth 3 times in a row. Where and how should I add this to my kam config?
Any help would be greatly appreciated.
Thanks _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Thursday 30 January 2014 04:10:14 Salvatore Nuzzo wrote:
but I need some help figuring our where they should go. See, I really like how this guy bans users for 15 minutes for failing to auth 3 times in a row. Where and how should I add this to my kam config?
As soon as possible, so at the start of the request_route.
if a Authorization header is present: if(is_present_hf("Authorization"))
the check can be triggert anytime, so to avoid doing other stuff needlessly when the request will be blocked, do it asap.
BTW you should take a look at http://www.kamailio.org/wiki/tutorials/security/kamailio-security and comments on this work in progress.