Showing posts with label tls. Show all posts
Showing posts with label tls. Show all posts

Wednesday, January 13, 2021

Using the GNU Gatekeeper to create TLS tunnels

Most H.323 vendors did not implement encrypting the signaling connection with TLS. They only encrypt the media (RTP). But you can use the two GNU Gatekeepers to encrypt you call signaling even when your endpoints don't support this natively.

Suppose you have 2 locations and want to connect them securely over the public internet.

GnuGk can encrypt call signalling between those locations using TLS and encrypt the media (RTP) using H.235.6 (AES encryption). 


 Configuration for GNU Gatekeeper 1 (prefix 01)

 

[Gatekeeper::Main]

[RoutedMode]
GKRouted=1
H245Routed=1
CallSignalPort=1720
AcceptUnregisteredCalls=1
; make sure H.245 gets tunneled for TLS
H245TunnelingTranslation=1
; add AES media encryption if the endpoint doesn't encrypt itself
EnableH235HalfCallMedia=1
; only allow encrypted calls
RequireH235HalfCallMedia=1
; change the media key after 2^31 operations
EnableH235HalfCallMediaKeyUpdates=1

[Proxy]
Enable=1

[ModeSelection]
0.0.0.0/0=PROXY
; only use routed mode for local calls
192.168.0.0/18=H245ROUTED

[TLS]
EnableTLS=1
PrivateKey=/path/to/server.pem
Certificates=/path/to/server.pem
CAFile=/path/to/rootcert.pem
Passphrase=MySecret
CheckCertificateIP=1

[Gatekeeper::Auth]
FileIPAuth=required;Setup

[FileIPAuth]
; allow all calls from local network
192.168.1.0/24=allow
; only allow TLS encrypted and authenticated calls from elsewhere
any=onlyTLS

[RasSrv::PermanentEndpoints]
; the GnuGk in the other location, serving prefix 02
1.2.3.4:1300=remote-gw;02

[EP::remote-gw]
; use TLS to call remote GnuGk
UseTLS=1 
 

Configuration for GNU Gatekeeper 2 (prefix 02)

[Gatekeeper::Main]

[RoutedMode]
GKRouted=1
H245Routed=1
CallSignalPort=1720
AcceptUnregisteredCalls=1
; make sure H.245 gets tunneled for TLS
H245TunnelingTranslation=1
; add AES media encryption if the endpoint doesn't encrypt itself
EnableH235HalfCallMedia=1
; only allow encrypted calls
RequireH235HalfCallMedia=1
; change the media key after 2^31 operations
EnableH235HalfCallMediaKeyUpdates=1

[Proxy]
Enable=1

[ModeSelection]
0.0.0.0/0=PROXY
; only use routed mode for local calls
192.168.0.0/18=H245ROUTED

[TLS]
EnableTLS=1
PrivateKey=/path/to/server.pem
Certificates=/path/to/server.pem
CAFile=/path/to/rootcert.pem
Passphrase=MySecret
CheckCertificateIP=1

[Gatekeeper::Auth]
FileIPAuth=required;Setup

[FileIPAuth]
; allow all calls from local network
192.168.1.0/24=allow
; only allow TLS encrypted and authenticated calls from elsewhere
any=onlyTLS

[RasSrv::PermanentEndpoints]
; the GnuGk in the other location, serving prefix 01
1.2.3.5:1300=remote-gw;01

[EP::remote-gw]
; use TLS to call remote GnuGk
UseTLS=1 
 

Other options

You could also configure the remote GNU Gatekeeper as a neighbor, but beware that the RAS traffic between neighbors will show meta data (whois is caling who) in clear text! 

See the GnuGk manual section on TLS for more details and examples how to generate the OpenSSL certificates. 

 

Friday, July 26, 2019

GNU Gatekeeper 5.3 released

I have just released GNU Gatekeeper version 5.3.

You can download it from https://www.gnugk.org/h323download.html

This release has a number of new features as well as some important bug
fixes.

Whats new ?

  • LRQ loop detection to optimize calls flows between multiple neighbor gatekeepers This new feature has the potential to significantly reduce the load on all gatekeepers and prevent "LRQ storms".
  • new routing policy to set call destinations by querying HTTP or REST servers, see [Routing::Http]
  • much improved support for SNMP
  • important bug fix for TLS encryption of signaling channels
  • important bug fixes for H.460.18 NAT traversal (for H.245 tunneling and for multi-homed servers)
  • performance optimization: this version can handle 5-10% more proxied  calls on the same hardware
  • performance optimization: re-authenticate lightweight, additive registrations only when new aliases differ. This significantly reduces the load on password databases.

Enjoy!


Full change log:

- BUGFIX(ProxyChannel.cxx) don't send H.245 address to tunneling
  H.460.18 endpoint, breaks call when H.245 multiplexing
- performance optimization: 5% faster UDP handling
- changed default: [SNMP] Implementation=PTlib
- remove unfinished Windows-SNMP implementation, use PTLib-SNMP on Windows
- support SET and GET-NEXT in PTLib-SNMP
- support SNMP sysUpTime when running as standalone agent
- BUGFIX(configure.in) LARGE_FDSET defaults to off
- new SNMP OID 1.3.6.1.4.1.27938.11.1.9 to query total bandwidth allocated to ongoing calls
- BUGFIX(ProxyChannel.cxx) fix hangup when making many TLS calls quickly one after another
- BUGFIX(RasSrv.cxx) don't require H.460.22 parameters in ARQs
- BUGFIX(ProxyChannel.cxx) fix TLS without LARGE_FDSET
- BUGFIX(ProxyChannel.cxx) don't send H.460.22 priority field in SCI
- BUGFIX(gkauth.cxx) free memory from cached and expired passwords
- re-authenticate lightweight, additive registrations only when new aliases differ
- remove switch [Proxy]DisableRTPQueueing, always disabled now
- new routing policy: http with config section [Routing::Http]
- BUGFIX(ProxyChannel.cxx) fix H.460.18 on multi-homed servers (SCI comes from the correct IP now)
- new switch to disable SNMP traps [SNMP] EnableTraps=0
- BUGFIX(ProxyChannel.cxx) don't throw SNMP trap on H.245 connection errors
  (causes crash under load with Net-SNMP)
- BUGFIX(snmp.cxx) shutdown GnuGk when SNMP agent can't be started
- BUGFIX(snmp.cxx) protect NetSNMP library calls with mutex
- changed default: ForwardResponse now defaults to 1 in [RasSrv::LRQFeatures] and [Neighbor::...]
- new feature: loop detection for LRQs [RasSrv::LRQFeatures] LoopDetection=1
- BUGFIX(Neighbor.cxx) some settings in [RasSrv::LRQFeatures] were ignored if not set in [Neighbor::...]

Tuesday, January 28, 2014

H.323Plus 1.26 released

A new H323Plus is out: Version 1.26

  • it allows you to add TLS encryption to your endpoints (including H.460.22 capability negotiation)
  • it supports the upcoming H.235.6 with Diffie-Helman keys up to 8 KB length
  • there is support for media over TCP (H.460.26)
  • support for H.323v8 language features
If you have endpoints based on H323Plus (or OpenH323), I would encourage you to update to the latest library version and enable those new features!

H323Plus v1.26 of course also works great with GnuGk 3.5.

Download H323Plus 1.26 from h323plus.org.

Wednesday, January 8, 2014

Whats new in GnuGk 3.5 ? Part 1: New encryption features

Easier TLS configuration

H.323 encryption as implemented by virtually all commercial vendors is easily circumvented by Man-in-the-Middle attacks. So it is very important to secure at least your gatekeeper-to-gatekeeper signaling connections over the internet with TLS. See https://www.gnugk.org/h323-encryption.html for background information. (Its a bit like installing a huge lock and then leaving the key under the doormat for everybody to use.)

GnuGk can close this security hole by encrypting the signaling connection using TLS and verifying  the certificates of clients and servers.

With GnuGk 3.5, you don't have explicitly configure TLS for each partner. On all RAS connections GnuGk will use H.460.22 to signal support for TLS encryption and will automatically use it as when the partner supports it.

Stronger RTP encryption with larger keys

When the media encryption spec (H.235.6) was published by the ITU in 2005, it contained an error that prevents all vendors from using Diffie-Hellman tokens larger than 2048 bits. This error is being corrected by the ITU now and the new spec is about to be published.

GnuGk 3.5 supports the upcoming specification and can be configured to use AES256 with tokens of up to 8192 bits when you configure it to add media encryption to your calls.

Support for legacy authentication with DES-ECB

GnuGk 3.5 adds support for username / password authentication using the DES standard. This kind of authentication is very weak and should only be used for interoperability with old equipment that doesn't support anything else (eg. some Avaya endpoints).

Thursday, January 2, 2014

GNU Gatekeeper Version 3.5 released

I'm happy to announce the release of GNU Gatekeeper version 3.5.
The new version brings a number of new features as well as a number of
important bug fixes and a few changes in configuration options.

As usual, you can download the source code and executable for Linux, Windows, FreeBSD, OpenBSD, NetBSD and Solaris from https://www.gnugk.org/h323download.html.

New features:

  • implement H.460.22 to negotiate the use of TLS
  • language based routing (using the upcoming H.323v8)
  • new command line switch -mlock to prevent GnuGk from being swapped out
  • new section [ModeVendorSelection] to set proxy mode based on endpoint vendor
  • support for challenge/response authentication using DES-ECB, eg. from Avaya endpoints
  • new switch [RoutedMode] FilterEmptyFacility= (Avaya interop)
  • new switch [RoutedMode] ProxyHandlerHighPrio=0 to avoid setting the proxy handler to  high priority; needed to run GnuGk on certain virtualization platforms
  • print number of proxied calls and peak number of calls in statistics on status port
  • new switch [RoutedMode] H46023ForceNat
  • new switch [RewriteSourceAddress] TreatNumberURIDialedDigits
  • more detailed codec descriptions in %{codec} and Radius attribute
  • process multiple terminal-alias VSA from Radius
  • extend [GkStatus::Message] for URQ

 Configuration changes:

  • changed default call signaling port from 1721 to 1720
  • replace H235HalfCallMediaStrength= switch with H235HalfCallMaxTokenLength= switch
  • disable use of SHA1 for TLS by default, the new switch [TLS] CipherList= can be used to customize the cipher selection

Bug fixes:

  • BUGFIX(GkStatus.cxx) disable ssh compression to avoid libssh bug, fix memleak, implement cmdline command execution
  • BUGFIX(Neighbor.cxx) fix H.460 VendorInfo in LCF without TLS or NAT Support
  • BUGFIX(Routing.cxx) fix DNS policy to allow calls by IP:port to endpoint on same IP as gatekeeper
  • BUGFIX(ProxyChannel.cxx) fix RTCP forwarding with EnableRTCPStats=1
  • BUGFIX(ProxyChannel.cxx) fix race condition in call failover
  • BUGFIX(ProxyChannel.cxx) fix use of RTP multiplex port for non-multiplexing calls
  • BUGFIX(ProxyChannel.cxx) offer H.245 tunneling for H.460.18 calls when translation switch is on
  • BUGFIX(ProxyChannel.cxx) fix removal of h245Address in H.245 tunneling translation
  • BUGFIX(ProxyChannel.cxx) fix H.245 tunneling translation when H.245 connection is  actively established by the gatekeeper and there are pending H.245 messages
  • BUGFIX(ProxyChannel.cxx) don't send a ReleaseComplete for Status messages outside of calls
  • BUGFIX(ProxyChannel.cxx) use Facility with reason transportedInformation for  H.245 tunneling translation for H.225 version >= 4
  • BUGFIX(RasSrv.cxx) fix port detection for traversal clients
  • BUGFIX(RasTbl.h) fix translation of 2nd CallProceeding to unregistered endpoint
  • BUGFIX(yasocket.h) fix TLS with LARGE_FDSET