text
stringlengths
0
152
*CLI> acl show named_acl_1
ACL: named_acl_1
---------------------------------------------
0: deny - 0.0.0.0/0.0.0.0
1: allow - 10.1.1.50/255.255.255.255
2: allow - 10.1.1.55/255.255.255.255
Now, instead of having to potentially repeat the same permit and deny entries in mul‐
tiple places, you can apply an ACL by its name. You will find an acl field in the
ps_endpoints table, which you can use to point to a named ACL in the acl.conf file.
mysql> select id,transport,aors,context,disallow,allow,acl from ps_endpoints;
|id |transport |aors |context|disallow|allow |acl |
|0000f30A0A01|transport-udp|0000f30A0A01|sets |all |ulaw |NULL|
|0000f30B0B02|transport-udp|0000f30B0B02|sets |all |ulaw |NULL|
|SOFTPHONE_A |transport-udp|SOFTPHONE_A |sets |all |ulaw,h264,vp8|NULL|
|SOFTPHONE_B |transport-udp|SOFTPHONE_B |sets |all |ulaw,h264,vp8|NULL|
mysql> update ps_endpoints
set acl='local_phones'
where id in ('0000f30A0A01','0000f30B0B02','SOFTPHONE_A','SOFTPHONE_B')
;
mysql> select id,transport,aors,context,disallow,allow,acl from ps_endpoints;
|id |transport |aors |context|disallow|allow |acl |
|0000f30A0A01|transport-udp|0000f30A0A01|sets |all |ulaw |local_phones|
|0000f30B0B02|transport-udp|0000f30B0B02|sets |all |ulaw |local_phones|
|SOFTPHONE_A |transport-udp|SOFTPHONE_A |sets |all |ulaw,h264,vp8|local_phones|
|SOFTPHONE_B |transport-udp|SOFTPHONE_B |sets |all |ulaw,h264,vp8|local_phones|
Use ACLs when possible on all privileged accounts for network
services.
Another way you can mitigate security risk is by configuring call limits. The recom‐
is to use the GROUP() and
mended method for
GROUP_COUNT() dialplan functions. Here is an example that limits the number of calls
from each SIP peer to no more than two at a time:
implementing call
limits
374
|
Chapter 22: Security
exten => _X.,1,Set(GROUP(users)=${CHANNEL(endpoint)})
same => n,NoOp(${CHANNEL(endpoint)} : ${GROUP_COUNT(${CHANNEL(endpoint)})} calls)
same => n,GotoIf($[${GROUP_COUNT(${CHANNEL(endpoint)})} > 2]?denied:continue)
same => n(denied),NoOp(There are too many calls up already. Hang up.)
same => n,HangUp()
same => n(continue),NoOp(continue processing call as normal here ...)
Use call limits to ensure that if an account is compromised, it can‐
not be used to make hundreds of phone calls at a time.
Resources
Some security vulnerabilities require modifications to the Asterisk source code to
resolve. When those issues are discovered, the Asterisk development team puts out
new releases that contain only fixes for the security issues, to allow for quick and easy
upgrades. When this occurs, the Asterisk development team also publishes a security
advisory document that discusses the details of the vulnerability. We recommend that
you subscribe to the asterisk-announce mailing list to make sure that you know about
these issues when they come up.
Subscribe to the asterisk-announce list to stay up to date on Aster‐
isk security vulnerabilities.
One of the most popular tools for SIP account scanning and password cracking is
SIPVicious. We strongly encourage that you take a look at it and use it to audit your
own systems. If your system is exposed to the internet, others will likely run SIPVi‐
cious against it, so make sure that you do that first.
Conclusion—A Better Idiot
There is a maxim in the technology industry that states, “As soon as something is
made idiot-proof, nature will invent a better idiot.” The point of this statement is that
no development effort can be considered complete. There is always room for
improvement.
When it comes to security, you must always bear in mind that the people who are
looking to take advantage of your system are highly motivated. No matter how secure
your system is, somebody will always be looking to crack it.
Resources
|
375
We’re not advocating paranoia, but we are suggesting that what we have written here