SIP &TLS
Security in a peer to peer world
Olle E. Johansson, oej@edvina.net, Fosdem 2016, january 30-31, Brussels

Twitter @oej
TLS IN ONE PICTURE
Server
Network
Link
Application
Client
Identity check
Algorithm agreement
Key Set up
Encryption of data
Without prior agreement
Certificate validation
A SIP REGISTRATION AND CALL
SIP client/server

(phone)
SIP serverHello, here’s my current location

SIP Contact URI

(IPv6 or IPv4 address + port)
Incoming callIncoming call
Contact

URI
Two separate

Connections/Flows
…WITHTLS
SIP client/server

(phone)
SIP server
Hello, here’s my current location

SIP Contact URI

(IPv6 or IPv4 address + port)
Incoming call
Incoming call
TLS
TLS
The phone needs
to be a TLS server with a
certificate
Contact

URI
The cert needs to match

the Contact URI.

Which is changing unless you use GRUU
Contact

URI
SIPS: - WAS A BAD IDEA.
Just forget it. SIP doesn’t work like the
web.And the web is also changing.
SIP MATCHING CERTIFICATE
sip:alice@example.com
SIP server
cn: example.com
san: ww.example.com
SIP server
cn: namn.se
san: example.com
SIP server
cn: example.com
DNS SRV for example.com points to

sip01.siphosting.com
FAIL
OK!OK!
SIP server
cn: *.example.com
Fail
Wildcards are

not allowed.
With no SAN, CN is used.

But only with no SAN.
RFC 5922 - SIP domain certificates
COMPARE WITH XMPP -
CONNECTION = “AVAILABLE”
XMPP client
XMPP

server
Incoming message
TLS
A client without a
connection is off line.
OneTCP/TLS connection.
SIP XMPP STYLE

= SIP OUTBOUND
SIP client/server

(phone)
SIP server
Incoming call
TLS
Reuse the same connection,
managed by the client!
REGISTER
INVITE
As long as we have at least
one connection, the UA is ”online”
and available.
RFC 5626
SIP OUTBOUND AND IP FLOWS
SIP
”it’s really hard to notice that aTCP connection is dead”

Panagiotis Stathopoulos at #Fosdem 2016
UA
SIP
SIP
SIP edge proxys
SIP location server
SECURITY? 

NO GUARANTEES, EVER
SIP SIP
UA UA
You can only control and

verify the first hop
SIP PEER 2 PEER
SIP proxy

(man in the middle)
…WITH FORKING
The payload and message reach

everyone!
AND CONFERENCE CALLS
MY QUESTION:

A SECURE SESSION IS?
SIP proxy

(man in the middle)
SIP is a rendevous
protocol. We find each other and
establish a session.
Can we find a way to secure that
session and trust it?
MY QUESTION:

WHAT IS A SECURE SESSION?
SIP proxy

(man in the middle)
MSRP? 

WebRTC Datachannels? This applies to webrtc,
XMPP, SIP and other
solutions…
IN SHORT FOR SIP: WITHOUT
OUTBOUND,YOU’RE A NO GO
Managing client certs is a
pain and a high cost.
The standards doesn’t
work, only outbound…
WORKTO DO
Kill SIPS: 

Finally. Get rid of it.
Clarify SIP/TLS usage.
Mandate outbound for UAs.
Standardize SIP client
certificates.
Standardise DANE usage in
SIP.
Work on Peer-to-
peer security for all
protocols.

SIP & TLS - Security in a peer to peer world

  • 1.
    SIP &TLS Security ina peer to peer world Olle E. Johansson, oej@edvina.net, Fosdem 2016, january 30-31, Brussels
 Twitter @oej
  • 2.
    TLS IN ONEPICTURE Server Network Link Application Client Identity check Algorithm agreement Key Set up Encryption of data Without prior agreement Certificate validation
  • 3.
    A SIP REGISTRATIONAND CALL SIP client/server
 (phone) SIP serverHello, here’s my current location
 SIP Contact URI
 (IPv6 or IPv4 address + port) Incoming callIncoming call Contact
 URI Two separate
 Connections/Flows
  • 4.
    …WITHTLS SIP client/server
 (phone) SIP server Hello,here’s my current location
 SIP Contact URI
 (IPv6 or IPv4 address + port) Incoming call Incoming call TLS TLS The phone needs to be a TLS server with a certificate Contact
 URI The cert needs to match
 the Contact URI.
 Which is changing unless you use GRUU Contact
 URI
  • 5.
    SIPS: - WASA BAD IDEA. Just forget it. SIP doesn’t work like the web.And the web is also changing.
  • 6.
    SIP MATCHING CERTIFICATE sip:alice@example.com SIPserver cn: example.com san: ww.example.com SIP server cn: namn.se san: example.com SIP server cn: example.com DNS SRV for example.com points to
 sip01.siphosting.com FAIL OK!OK! SIP server cn: *.example.com Fail Wildcards are
 not allowed. With no SAN, CN is used.
 But only with no SAN. RFC 5922 - SIP domain certificates
  • 7.
    COMPARE WITH XMPP- CONNECTION = “AVAILABLE” XMPP client XMPP
 server Incoming message TLS A client without a connection is off line. OneTCP/TLS connection.
  • 8.
    SIP XMPP STYLE
 =SIP OUTBOUND SIP client/server
 (phone) SIP server Incoming call TLS Reuse the same connection, managed by the client! REGISTER INVITE As long as we have at least one connection, the UA is ”online” and available. RFC 5626
  • 9.
    SIP OUTBOUND ANDIP FLOWS SIP ”it’s really hard to notice that aTCP connection is dead”
 Panagiotis Stathopoulos at #Fosdem 2016 UA SIP SIP SIP edge proxys SIP location server
  • 10.
    SECURITY? 
 NO GUARANTEES,EVER SIP SIP UA UA You can only control and
 verify the first hop
  • 11.
    SIP PEER 2PEER SIP proxy
 (man in the middle)
  • 12.
    …WITH FORKING The payloadand message reach
 everyone!
  • 13.
  • 14.
    MY QUESTION:
 A SECURESESSION IS? SIP proxy
 (man in the middle) SIP is a rendevous protocol. We find each other and establish a session. Can we find a way to secure that session and trust it?
  • 15.
    MY QUESTION:
 WHAT ISA SECURE SESSION? SIP proxy
 (man in the middle) MSRP? 
 WebRTC Datachannels? This applies to webrtc, XMPP, SIP and other solutions…
  • 16.
    IN SHORT FORSIP: WITHOUT OUTBOUND,YOU’RE A NO GO Managing client certs is a pain and a high cost. The standards doesn’t work, only outbound…
  • 17.
    WORKTO DO Kill SIPS:
 Finally. Get rid of it. Clarify SIP/TLS usage. Mandate outbound for UAs. Standardize SIP client certificates. Standardise DANE usage in SIP. Work on Peer-to- peer security for all protocols.