I am a bit confused with too many places where one can filter inbound IP traffic. This is the list in what I think is the hirearchy for traffic coming in from outside to PIAF either to register as remote extension or ITSP.
1) your hardware firewall
2) PIAF IP Tables
3) FPBX IAX & SIP Seurity section (Asterisk global rules: deny, permit)
4) FPBX per Extension (deny, permit)
I think this is the hierarchy.
Comments:
My hardware firewall is ClarkConnect (old edition, now it is called 'Clear Foundation - Clear OS') and I don't seem to have the ability to only permit inbound traffic from specified IPs to given ports, that is I can only open ports but can't associate them with IPs allowed to use them. But I might be mistaken about that or perhaps the new ClearOS firewall does have this ability and I should upgrade...
--> But I suppose I can get the same functionality by allowing only certain IPs in PIAF IP tables? Right?
Then it shouldn't matter that I have 5000-5082 & 10000-20000 ports open on my firewall forwarded to PIAF, right?
I have some doubts about point 3 - the global permisions. I mean the rules set there don't seem to do anything but I didn't do rigorous testing and can't claim to be some expert.
Also it has no description like if deny should come first in line and permits following. I use PC remote access software with IP access filtering where the logic is you permit what IPs you want to allow access from and then on bottom line you deny everything else, here it is in reverse, at least I assume the advice I got here on forum regarding this was correct (deny on first line, then permits following) - but this should be spelled out in the popup clue description (I suppose those fields are used for other tasks than just IP fitering and so they didn't state any rules incl. those for deny permit)
I did play with placing deny last, also deny on first and last line but it didn't seem to matter, I mean I wasn't getting any effect I could see that it does anything (but that might be because registrations stick for a while even if all traffic from those IPs is blocked, however I could remotely connect to another location and register extension from there while the IP of that location wasn't permitted, it got me confused

also not sure if simply saving & reloading is enough for these changes to take effect, maybe iptables should be restarted but not knowing the command I also restarted whole PIAF few times during this testing to make sure)
On the other hand the per extension IP filtering does work but I miss having more than one entry field for IP 'permit' (one of my remote extension IP changes even in its first octet and so I can't use this per extension permit setting, it would have to have several fields or allow something like
90.0.0.0-
96.0.0.0/255.0.0.0
which I don't know if that is allowed there. If it was I'd just filter right at the extension level and forget about global settings.
Actually I don't know if this global permissions are superseeded by IP tables by I suppose they are. But then I don't see the point using both as they seem to do the same job only you have to fill in more lines, I'd put my eggs just into IP tables, is that right?
-------------------------------
Bottom line in security is I suppose how much money you have deposited with ITSPs (assuming one has only those that won't extend you any credit) and most you can loose is what you got prepaid, right? Or can someone break into your PIAF and register trunk someplace where they give credit no questions asked and he runs up huge bill on this trunk... but still he'd have to register there under your credentials for you to get stuck with the bill afterwards, right?