<p></p>
<p>Hi Daniel</p>
<p>In the pike ban I'd add a reason instead of a 1 to the htable key value. Something like</p>
<p>if (!pike_check_req()) {<br>
xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");<br>
$sht(ipban=>$si) = "pike";<br>
exit;<br>
}</p>
<p>This is because you can ban IP addresses lfor other reasons and it's nice to see what it is. In the default config file only if they key exists is checked so having a 1 or another thing doesn't alter the behaviour.</p>
<p>Another ban reason example I use (copied from Fred Postner I think):</p>
<p>if($au =~ "(=)|(--)|(')|(#)|(%27)|(%24)" && $au!=$null) {<br>
xlog("L_WARNING","AU SQL injection $au from $si:$sp R=$ru\n");<br>
$sht(ipban=>$si) = "sql";<br>
exit;<br>
}</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2719#issuecomment-829024246">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZI6HYMX4E2KHUFIVI3TLEG63ANCNFSM43ZGGYPA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZLGCNYV5VL7EYABUTTTLEG63A5CNFSM43ZGGYPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGFU6P5Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2719#issuecomment-829024246",
"url": "https://github.com/kamailio/kamailio/issues/2719#issuecomment-829024246",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>