跳到主要内容

4. WebRTC 应用的安全性 (Security for WebRTC Applications)

4. WebRTC 应用的安全性 (Security for WebRTC Applications)

WebRTC applications 决定其创建的 sessions 的 security policies. 本节描述 applications 可用的 security mechanisms 以及它们应如何使用.

为防止 "calling card" attacks (Section 3.1), WebRTC 要求 receiving endpoint 明确同意接收 traffic. 这通过 Interactive Connectivity Establishment (ICE) protocol [RFC8445] 完成. 在向 destination 发送任何 non-ICE traffic 之前, WebRTC endpoint MUST 验证 destination 已响应 ICE STUN binding request. 这证明 destination 是活动的, 并愿意在该 port 上接收 traffic.

为防止 spying (Section 3.2), browsers MUST 在允许 site 访问 camera 或 microphone 之前要求明确的 user consent. 该 consent SHOULD 针对请求访问的 origin, 并且 SHOULD 可撤销.

4.3 安全通信 (Secure Communication)

为提供 confidentiality 和 integrity, 所有 WebRTC media 和 data traffic MUST 被加密和认证.

  • 对于 media (audio/video), 使用 SRTP [RFC3711], 并通过 DTLS-SRTP [RFC5764] 派生密钥.
  • 对于 data channels, 使用 SCTP over DTLS [RFC8261].

这确保 network path 上的 attackers 无法读取或修改通信.

4.4 身份 (Identity)

虽然 DTLS 提供 channel 的 authentication, 但它并不固有地标识另一端的 user. WebRTC 提供 mechanisms, 使 "Identity Providers" (IdPs) 能够断言 users 的 identity, 并将这些 identities 绑定到 call 所用的 DTLS certificates. 这允许 users 独立于 signaling service 验证自己正在与谁通信.