FYI API BAN 2024: Block Bad SIP/HTTP Traffic

Old Nerd Vittles tutorial to install APIBAN is here. Just search for apiban section to begin.
 
Last edited:
Current APIBAN deployment instructions here. Be sure to use latest dev release from here.

I recommend also adding the following lines immediately below the fail2ban line in /usr/local/sbin/iptables-restart in case the APIBAN table gets poisoned thereby locking you out of your server:
Code:
rm -f /var/log/apiban-client.log
/usr/local/bin/apiban/apiban-iptables-client
/usr/sbin/iptables -I APIBAN -s 10.8.0.0/24 -j ACCEPT
/usr/sbin/iptables -I APIBAN -s 1.1.1.1 -j ACCEPT
/usr/sbin/iptables -I APIBAN -s 8.8.8.8 -j ACCEPT
/usr/sbin/iptables -I APIBAN -s 127.0.0.1 -j ACCEPT
 
Last edited:
Alternative way of whitelisting is to use this new syntax in config.json which tells the APIBAN app to ignore adding the specified IP addresses to the chain. My problem with this approach is these whitelisted APIBAN addresses aren't really whitelisted. They are simply ignored when the APIBAN table is populated. That means they don't show up in the chain so it's up to you to be sure they are also added in the INPUT chain.

{
"apikey":"MY API KEY",
"lkid":"100",
"version":"1.5",
"set":"sip",
"flush":"200",
"allowed":[
{
"cidr":"1.1.1.1/32"
},
{
"cidr":"8.8.8.8/32"
},
{
"cidr":"127.0.0.1/32"
},
{
"cidr":"10.8.0.0/24"
}
]
}
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top