RECOMMENDATIONS Install and build asterisk with srtp support

gordon

Member
Joined
Jun 7, 2013
Messages
96
Reaction score
7
Is there any reason SRTP and TLS are not configured by default?

I've been experimenting with encryption I finally appear to have something working with IncrediblePBX 11.4 and CentOS 6.5

I had to rebuild asterisk with support for srtp.

It would be helpful if srtp was installed and enable in asterisk by default (maybe it is in newer versions?)

Here is a list of commands that were required:

Code:
cd /usr/local/src/
wget https://downloads.sourceforge.net/project/srtp/srtp/1.4.4/srtp-1.4.4.tgz
tar zxvf srtp-1.4.4.tgz
cd /usr/local/src/srtp
./configure CFLAGS=-fPIC
make && make install
 
 
cd /usr/src/asterisk*
amportal stop
./configure
make && make install
amportal start


Also, on a related note, it might be helpful if TLS was also enabled by default. Apache installs self signed keys that can be used. On CentOS they are "/etc/pki/tls/certs/localhost.crt" and "/etc/pki/tls/private/localhost.key".

Code:
cat /etc/pki/tls/private/localhost.key > /etc/pki/tls/private/localhost.pem
cat /etc/pki/tls/certs/localhost.crt >> /etc/pki/tls/private/localhost.pem
chmod 0400 /etc/pki/tls/private/localhost.pem
chown asterisk:asterisk /etc/pki/tls/private/localhost.pem
 
cp /etc/asterisk/sip_general_custom.conf /etc/asterisk/sip_general_custom.conf.bak
echo "tlsenable=yes" >> /etc/asterisk/sip_general_custom.conf
echo "tlscertfile=/etc/pki/tls/private/localhost.pem" >> /etc/asterisk/sip_general_custom.conf
 
amportal restart



So far I seem to be able to register with TLS and check voicemail using SRTP. Note that if you are using the Media5-fone app you must uncheck the "Enable MKI" option because of an outstanding bug in asterisk (https://issues.asterisk.org/view.php?id=19339)
 

hecatae

resident hecatae
Joined
Feb 7, 2014
Messages
760
Reaction score
199
if your voip device does not enable srtp and tls by default, what happens?

do you get registration failure, do you miss calls?

fires up a vps to test
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
I feel enabling crypto by default is high priority and immediately needed, in PBX-in-a-Flash and IncrediblePBX.
These build flags mentioned by @gordon should be added to the mainline PIAF/iPBX build script as long as they have passed inspection by @wardmundy (12 months ago)
Secure all communications by default.
Have a fallback to clear text, only if the other end doesn't support crypto.
For example, use TLS authentication on port 5061 if the port's there and listening, regardless of the user has selected an unencrypted protocol (UDP or TCP).
Use DTLS SRTP by default.
More:
Start at 19:30
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Re: Crypto by Default

Too many rules and minefields IMHO. Easier and legally safer to let folks do it on their own.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Re: Crypto by Default

Too many rules and minefields IMHO. Easier and legally safer to let folks do it on their own.
These are valid concerns. The rules I quoted from the Olle Johansson talk, above, were SIP client "rules," (ignore user UDP setting and use TLS if available) and not server rules.
On the IPBX server build script, TLS and SRTP should (dare I say must) be added to asterisk by default.
The easy, pain free, way to accomplish this is obviously to add the few lines which download and make install srtp, before doing "configure", and secondly, to copy the apache tls certs to the appropriate location for asterisk to pick them up and use them to start the tls session when a phone attempts a tls connect. Done.

If any person who runs the IPBX install script insists on running either or both sip protocol and call audio in cleartext (potentially recklessly exposing their users' calls, from coffee shops, to be tapped by anyone, calls to their bank, compromising their pin codes, social security numbers, etc!) then they should be the ones who have to go out of their way to edit the build script by adding a compile time switch that removes the SRTP and skips copying the apache tls certs into the folder where asterisk requires them.

Doesn't this make sense?
Make the "no security" scenario something that you have to choose to go out of your way to make efforts to disable things to obtain.
Do nothing and you get default middle grade self signed encryption certs and encrypted audio/video, turned on on both SIP signalling protocol, and the audio.
 
Last edited:

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Here is some reading

https://askcalea.fbi.gov/standards.html

I suspect Ward's response is related to putting out a project with strong crypto enabled by default and does not have a specific method of enforcing CALEA or whatever the current executive order dejour from our fearless leader (https://en.wikipedia.org/wiki/Fearless_Leader) is inviting the wrath of Uncle Sugar and his henchman Boris. Can you imagine getting a national security letter forcing you to assist an alphabet soup agency with this?

Regardless there are already a number of ways to circumvent things. For example hypothetically you could enable encryption on IAX and then only connect through an encrypted vpn pipe (Of which you control the mediation server) That might take Boris and his quantum computer a few seconds to decrypt. Now if everybody did that at once Boris may have trouble keeping up however the Uncle Sugar and the military are among the worlds largest consumers of data storage devices (closely followed by google!)

ZRTP I suspect is the only salvation out there at the moment without going through a central switch like freeswitch. Freeswitch can be used as a man in the middle or a mediation type server (ZRTP Passthrough). The man in the middle (MITM) with zrtp is calea and other executive order dejour compliant as Boris can slap a warrant on you and force you to let them listen in. Where as the mediation type may not be as you use it to simply point two encrypted connections to each other. Wish I had time to make zrtp work with asterisk it would be the B*mb (Don't want to trip uncle sugars key word search monitor! course I am sure SRTP and ZRTP does). BTW Freeswitch does NOT enable it by default probably for the same reasons

My advice is encrypt everything! I was playing with running freeswitch on a single board computer and placing it in a voip phone which created a zrtp standalone phone..... wish I had more time to do stuff.

Tom
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Is there any reason SRTP and TLS are not configured by default?
So far I seem to be able to register with TLS and check voicemail using SRTP. Note that if you are using the Media5-fone app you must uncheck the "Enable MKI" option because of an outstanding bug in asterisk (https://issues.asterisk.org/view.php?id=19339)
Are you sure your connection is encrypted with SIP/TLS and SRTP? Some icon in the softphone that shows a padlock for encrypted audio and sip signals.

Because the official asterisk documentation says that getting SIP/TLS and SRTP working is more manual intervention that this. In order the encrypt with SIP/TLS and SRTP, it says, you need to both manually generate certs, AND copy BOTH the client cert AND the self-signed CA cert, from the asterisk pbx to the endpoint/softphone/voip desk phone.
https://wiki.asterisk.org/wiki/display/AST/Secure+Calling+Tutorial

This is why ZRTP looks more suitable, the ZRTP protocol code generates session keys more or less on the fly, no manual preconfiguration required, using Diffie-Hellman key exchange, in order to eliminate the copying of certs to the client softphone/desk voip phone.
ZRTP is designed to provide a secure method for two VoIP end-point to securely agree encryption keys that are subsequently used to encrypt media streams (voice or video) using SRTP. ZRTP uses the Diffie-Hellman algorithm which enables secure key agreement and avoids the overhead of certificate management or any other prior setup. ZRTP supports two Diffie-Hellman variants, finite field and elliptic curve. The keys agreed by ZRTP are ephemeral which means that they are discarded at the end of a call, avoiding the need for key management.
source: http://www.voip-info.org/wiki/view/ZRTP
 
Last edited:

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Did you know... whether you're a huge ISP or a small fry voip operator, you can charge law enforcement significant fees for complying with their CALEA warrants.

Why not then implement CALEA module for incredible pbx?? Small fry Incredible PBX VOIP operators would be overjoyed to have this be a revenue stream and would surely pay $50 for the module. Sales of 1000's of the modules is practically guaranteed if only for the peace of mind, plus the revenue from charging for CALEA warrant compliance.

Comcast charges $1000, to law enforcement/federal justice department, per CALEA warrant request and first month of service, plus $750 per month there after. $150 per week for weekly delivery of CDR call detail records. Plus many other fees. Here are their fee details..

http://puck.nether.net/pipermail/voiceops/2013-January/003955.html

Reimbursement Fees

The Legal Response Center does not charge for responses to legal process served by a government entity involving child exploitation. In all other situations, Comcast reserves the right to seek reimbursement for processing and responding to legal process as permitted by law. Our policy is to discuss reimbursement with the requesting party before we incur any costs. However, in time-sensitive situations we may have to discuss costs after the fact.

Costs for the implementation of a Court Ordered Pen Register/Trap and Trace, Wiretap, or a CALEA compliant Order are as follows:

• CALEA intercept: $1,000.00 initial start-up fee (including the first month of intercept service) and $750.00 per month for each subsequent month in which the original order or any extensions of the original order are active.
• Call Detail Record releases in response to ongoing Court Order: $150.00 per week for once-per-week delivery of incoming and outgoing call detail records for the duration of the original order and any extensions of the original order. More frequent delivery of call detail records is an additional $50.00 per delivery.

Massive income stream possibility for the small fry voip operators!
 
Last edited:

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
I suspect the designing and implementation of such a module would be cost prohibitive! Interesting concept however....... Real problem is that ZRTP in MITM mode would be the only one that you *might* have a chance of being able to complying with the tap capability including the audio portion of the event. The metadata should not present a problem as I seem to remember that there is something out there (Not for calea purposes) that mines the data. Using ZRTP in PM makes it impossible to provide any audio data, small wonder that there are quite a number of offshore virtual PBX providers beyond the reach of Uncle Sugar and Boris. Although with Obozo insisting that US law is enforceable worldwide under the aegis of antiterrorism it makes you wonder...... Ah well the conspiracy theorists have been

:beatdeadhorse5:

For a long time..... I also surmise that if you were to build a CALEA module it would open you up to all sorts of NSL ordering you to fall on your own sword..... no thanks. :tank:


Interesting thoughts


Tom
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Also

from: http://zfoneproject.com/faq.html#calea

Q: Is Zfone and ZRTP CALEA compliant?
Only Zfone's end users are involved
in the key negotiation, and CALEA
does not apply to end users.

A: Zfone's architecture likely renders that question moot. The Communications Assistance for Law Enforcement Act applies in the US to the PSTN phone companies and VoIP service providers, such as Vonage. CALEA imposes requirements on VoIP service providers to give law enforcement access to whatever they have at the service provider, which would be only encrypted voice packets. ZRTP does all its key management in a peer-to-peer manner, so the service provider does not have access to any of the keys. Only Zfone's end users are involved in the key negotiation, and CALEA does not apply to end users.

Here is the operative language from CALEA itself:


  • 47 U.S.C. 1002(b)(3): ENCRYPTION - A telecommunications carrier shall not be responsible for decrypting, or ensuring the government's ability to decrypt, any communication encrypted by a subscriber or customer, unless the encryption was provided by the carrier and the carrier possesses the information necessary to decrypt the communication. [emphasis added]
Also, from the CALEA legislative history:


  • Finally, telecommunications carriers have no responsibility to decrypt encrypted communications that are the subject of court-ordered wiretaps, unless the carrier provided the encryption and can decrypt it. This obligation is consistent with the obligation to furnish all necessary assistance under 18 U.S.C. Section 2518(4). Nothing in this paragraph would prohibit a carrier from deploying an encryption service for which it does not retain the ability to decrypt communications for law enforcement access. [...] Nothing in the bill is intended to limit or otherwise prevent the use of any type of encryption within the United States. Nor does the Committee intend this bill to be in any way a precursor to any kind of ban or limitation on encryption technology. To the contrary, section 2602 protects the right to use encryption.
However, there is one usage scenario for the ZRTP protocol that may be subject to CALEA. Consider the case of a VoIP service provider that operates a PBX (such as Asterisk or FreeSWITCH) or conference call mixer for its customers. The service provider can implement the ZRTP protocol in the PBX, and this PBX can terminate the ZRTP media connections for both parties, acting as a trusted man-in-the-middle between two ZRTP-equipped end users, or act as a conference call mixer for several users. In this case, the PBX or conference bridge would be in a physical position to provide law enforcement access to either ZRTP or SRTP key material or actual plaintext media traffic, and thus be subject to CALEA. The usual end-to-end nature of ZRTP would be subverted. If your threat model includes this scenario, you may want to try to arrange direct end-to-end ZRTP connections whenever possible.



Tom
 

dziny

Guru
Joined
Sep 4, 2014
Messages
45
Reaction score
19
The problem with ZRTP is that the last functional implementation is for asterisk 1.4 which is literally ancient. In this sense the TLS/SRTP route is easier to implement and I have it working on my servers since Snowden revelations. It works successfully with variety of handsets starting with some really old ones (like Nokia E66/N95 using the native VOIP) through the most recent one - Android with CSipsimple and iOS on Bria.
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Yup tis why I recommend the use of freeswitch as it has native support. Don't want to go back to Asterisk 1.4 and yes TLS/SRTP does work but..... ZRTP may be somewhat better. Especially if you use the passthru mode on freeswitch impossible (to my knowledge) to implement the audio tap foe CALEA on this type of connection although there is still some metadata available that Obozo and his clowns may be interested in.


Tom
 

dziny

Guru
Joined
Sep 4, 2014
Messages
45
Reaction score
19
Yup tis why I recommend the use of freeswitch as it has native support. Don't want to go back to Asterisk 1.4 and yes TLS/SRTP does work but..... ZRTP may be somewhat better. Especially if you use the passthru mode on freeswitch impossible (to my knowledge) to implement the audio tap foe CALEA on this type of connection although there is still some metadata available that Obozo and his clowns may be interested in.


Tom
Indeed, you have to control the servers (including the physical control of the hardware, i.e. no servers in the cloud) to trust TLS/SRTP as the server is the natural location to decrypt/intercept the call. Not an issue for some but not all.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
We need to be clear on goals. Why do we want encryption enabled by default. What are we trying to get out of it.

Skype app turns on encryption for all communications, but microsoft still lets US DOJ lawfully wiretap any skype conversations, for big $$$$.

I have no problem US DOJ lawfully wiretap any asterisk/pbx in a flash voip conversation.

I just want the local hacker kids to be unable to intercept all voip conversations, which are currently cleartext, log them, and index them, and use them for financial $$$ fraud and social engineering.

Anti-fraud is the goal.

And forcing the user to install and configure a VPN on each handset is out of the question - it's too much work and nobody will do it - Skype does encryption without asking users to bend over backwards and practically gain a Cisco certification in order to configure their handset securely. Encyuption should "just work". All the user has to do is enter in their normal voip username, password, and server address. Done, padlock on, encrypted.

Point-to-point encryption from handset to voip server, is how we will achieve anti fraud.

ZRTP or SRTP either one offers this, but ZRTP is so much more effortless.

Zimmerman (creator of ZRTP) says a company has updated ZRTP to be compatible the more recent version of asterisk.

How about getting int touch with them and asking them if they would pull request contribute their code back to the master branch.
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
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.
Top