TURN 端到端的 WebRTC 流量是否加密? [英] Is WebRTC traffic over TURN end-to-end encrypted?

查看:71
本文介绍了TURN 端到端的 WebRTC 流量是否加密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WebRTC 流量使用 DTLS 加密 - 好的.但是通过 TURN 服务器中继的流量呢?

WebRTC traffic is encrypted using DTLS - ok. But what about traffic that's relayed over a TURN server?

我正在寻找一种可靠的资源来确认流量是真正端到端加密的(因为端到端"有时可能意味着几件事).所以我的意思是

I'm looking for a reliable resource which confirms that the traffic is truly end-to-end encrypted (because "end-to-end" can sometimes mean several things). So I mean

  • 并不是说对等方和 TURN 服务器之间存在端到端"加密.

相反,

  • 点对点之间是端到端的
  • 这样它就不会在 TURN 服务器上解密/重新加密
  • 并且 TURN 服务器无法访问机密

我一直无法找到明确的答案.

I haven't been able to find a definite answer to this.

推荐答案

看的地方是 TURN 提议的标准,RFC 5766.该标准提供了一种在客户端和对等端之间中继包含应用程序数据的 UDP 数据包的方法:

The place to look is the TURN proposed standard, RFC 5766. The standard provides a means for relaying UDP packets containing application data between a client and a peer:

创建分配后,客户端可以将应用程序数据连同数据将发送到哪个对等点的指示一起发送到服务器,并且服务器将此数据中继到适当的对等点.客户端在 TURN 消息中将应用程序数据发送到服务器;在服务器端,数据从 TURN 消息中提取出来并以 UDP 数据报的形式发送给对端.在相反的方向上,对等方可以将应用程序数据以 UDP 数据报的形式发送到中继传输地址以进行分配;然后,服务器会将这些数据封装在 TURN 消息中,并将其与发送数据的对等方的指示一起发送给客户端.

Once an allocation is created, the client can send application data to the server along with an indication of to which peer the data is to be sent, and the server will relay this data to the appropriate peer. The client sends the application data to the server inside a TURN message; at the server, the data is extracted from the TURN message and sent to the peer in a UDP datagram. In the reverse direction, a peer can send application data in a UDP datagram to the relayed transport address for the allocation; the server will then encapsulate this data inside a TURN message and send it to the client along with an indication of which peer sent the data.

TURN 解析的最高层是 UDP 层.它不理解或修改应用程序数据层(在您的情况下,WebRTC 协议).标准说:

The highest layer that TURN parses is the UDP layer. It does not understand or modify the application data layer (in your case, the WebRTC protocol). The standard says:

希望确保其数据不被更改或伪造的应用程序必须在应用程序级别对其数据进行完整性保护.

An application wishing to ensure that its data is not altered or forged must integrity-protect its data at the application level.

这意味着您可以对您的应用程序数据进行完整性保护,TURN 将不加修改地转发它.您还可以查看 TURN 协议的详细信息(这里不再赘述),它表明它只是包装和转发应用程序数据.

This implies that you can integrity-protect your application data, and TURN will relay it without modification. You can also look at the details of the TURN protocol (which I won't repeat here) that show that it merely wraps and forwards application data.

最后,关于窃听的标准是这样说的:

Finally, the standard says this on eavesdropping:

TURN 中继的应用程序数据最好保密由应用程序协议本身提供,因为运行 TURN overTLS 不保护服务器和服务器之间的应用程序数据同行.如果应用程序数据的机密性很重要,那么应用程序应加密或以其他方式保护其数据.为了例如,对于实时媒体,机密性可以由使用 SRTP.

Confidentiality for the application data relayed by TURN is best provided by the application protocol itself, since running TURN over TLS does not protect application data between the server and the peer. If confidentiality of application data is important, then the application should encrypt or otherwise protect its data. For example, for real-time media, confidentiality can be provided by using SRTP.

此摘录中的建议是通过使用 WebRTC 使用的 DTLS-SRTP 等协议加密应用程序数据来保护机密性.

The recommendation in this excerpt is to protect confidentiality by encrypting application data with a protocol such as DTLS-SRTP, which WebRTC uses.

因为 TURN 不解释或修改应用程序数据,所以它不会向 WebRTC 应用程序数据流量添加任何安全漏洞,如果不使用 TURN 就不会存在这些漏洞.WebRTC 数据在 WebRTC 端点之间加密.

Because TURN does not interpret or modify application data, it doesn't add any security vulnerabilities to WebRTC application data traffic that wouldn't be present without using TURN. WebRTC data is encrypted between WebRTC endpoints.

现在,没有人可以保证TURN 服务器无法访问机密".流氓 TURN 服务器可以尝试对您的连接进行中间人攻击,就像其他任何可以拦截您的网络数据包的人一样容易.确实,使用 TURN 中继不会削弱 WebRTC 安全性.

Now, no one can guarantee that there is "no way for the TURN server to get access to the secret." A rogue TURN server could attempt a man-in-the-middle attack on your connection just as easily as anyone else who can intercept your network packets. It's only true that using a TURN relay doesn't weaken WebRTC security.

只要正确实施和使用 DTLS,并假设 DTLS 算法和密码是安全的,WebRTC 流量就应该得到端到端的保护.使用任何基于 SSL 的方案的一部分需要验证另一个端点的证书,就像 HTTPS.就像 HTTPS 一样,这将需要事先进行带外证书身份交换或使用受信任的第三方.就像 HTTPS 一样,如果证书没有得到正确验证,那么中间人攻击的大门就会打开(任何人,而不仅仅是 TURN 服务器).

As long as DTLS is implemented and used properly and assuming the DTLS algorithms and ciphers are secure, WebRTC traffic should be secured end-to-end. Part of using any SSL-based scheme requires verifying the certificate of the other endpoint, just like HTTPS. And just like HTTPS, this will require a prior out-of-band exchange of certificate identity or use of a trusted third-party. And just like HTTPS, if certificates are not properly verified then the door will be open for a MITM attack (by anyone, not just TURN servers).

这篇关于TURN 端到端的 WebRTC 流量是否加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆