idnits 2.17.1 draft-ietf-rtcweb-security-arch-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: o Browsers MUST not permit permanent screen or application sharing permissions to be installed as a response to a JS request for permissions. Instead, they must require some other user action such as a permissions setting or an application install experience to grant permission to a site. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: o The browser MUST indicate any windows which are currently being shared in some unambiguous way. Windows which are not visible MUST not be shared even if the application is being shared. If the screen is being shared, then that MUST be indicated. == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 7, 2015) is 3331 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'WebMessaging' is defined on line 1731, but no explicit reference was found in the text == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-rtp-usage-22 == Outdated reference: A later version (-12) exists of draft-ietf-rtcweb-security-08 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 4572 (Obsoleted by RFC 8122) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5245 (Obsoleted by RFC 8445, RFC 8839) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 5785 (Obsoleted by RFC 8615) -- Possible downref: Non-RFC (?) normative reference: ref. 'WebMessaging' == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-jsep-08 -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) Summary: 8 errors (**), 0 flaws (~~), 8 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 RTCWEB E. Rescorla 3 Internet-Draft RTFM, Inc. 4 Intended status: Standards Track March 7, 2015 5 Expires: September 8, 2015 7 WebRTC Security Architecture 8 draft-ietf-rtcweb-security-arch-11 10 Abstract 12 The Real-Time Communications on the Web (RTCWEB) working group is 13 tasked with standardizing protocols for enabling real-time 14 communications within user-agents using web technologies (commonly 15 called "WebRTC"). This document defines the security architecture 16 for WebRTC. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on September 8, 2015. 35 Copyright Notice 37 Copyright (c) 2015 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 This document may contain material from IETF Documents or IETF 51 Contributions published or made publicly available before November 52 10, 2008. The person(s) controlling the copyright in some of this 53 material may not have granted the IETF Trust the right to allow 54 modifications of such material outside the IETF Standards Process. 55 Without obtaining an adequate license from the person(s) controlling 56 the copyright in such materials, this document may not be modified 57 outside the IETF Standards Process, and derivative works of it may 58 not be created outside the IETF Standards Process, except to format 59 it for publication as an RFC or to translate it into languages other 60 than English. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 65 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 66 3. Trust Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 67 3.1. Authenticated Entities . . . . . . . . . . . . . . . . . 5 68 3.2. Unauthenticated Entities . . . . . . . . . . . . . . . . 6 69 4. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 70 4.1. Initial Signaling . . . . . . . . . . . . . . . . . . . . 8 71 4.2. Media Consent Verification . . . . . . . . . . . . . . . 10 72 4.3. DTLS Handshake . . . . . . . . . . . . . . . . . . . . . 11 73 4.4. Communications and Consent Freshness . . . . . . . . . . 11 74 5. Detailed Technical Description . . . . . . . . . . . . . . . 12 75 5.1. Origin and Web Security Issues . . . . . . . . . . . . . 12 76 5.2. Device Permissions Model . . . . . . . . . . . . . . . . 12 77 5.3. Communications Consent . . . . . . . . . . . . . . . . . 15 78 5.4. IP Location Privacy . . . . . . . . . . . . . . . . . . . 15 79 5.5. Communications Security . . . . . . . . . . . . . . . . . 16 80 5.6. Web-Based Peer Authentication . . . . . . . . . . . . . . 18 81 5.6.1. Trust Relationships: IdPs, APs, and RPs . . . . . . . 19 82 5.6.2. Overview of Operation . . . . . . . . . . . . . . . . 20 83 5.6.3. Items for Standardization . . . . . . . . . . . . . . 22 84 5.6.4. Binding Identity Assertions to JSEP Offer/Answer 85 Transactions . . . . . . . . . . . . . . . . . . . . 22 86 5.6.4.1. Carrying Identity Assertions . . . . . . . . . . 23 87 5.6.4.2. a=identity Attribute . . . . . . . . . . . . . . 23 88 5.6.5. Determining the IdP URI . . . . . . . . . . . . . . . 24 89 5.6.5.1. Authenticating Party . . . . . . . . . . . . . . 25 90 5.6.5.2. Relying Party . . . . . . . . . . . . . . . . . . 25 91 5.6.6. Requesting Assertions . . . . . . . . . . . . . . . . 25 92 5.6.7. Managing User Login . . . . . . . . . . . . . . . . . 27 93 5.7. Verifying Assertions . . . . . . . . . . . . . . . . . . 27 94 5.7.1. Identity Formats . . . . . . . . . . . . . . . . . . 28 95 6. Security Considerations . . . . . . . . . . . . . . . . . . . 28 96 6.1. Communications Security . . . . . . . . . . . . . . . . . 29 97 6.2. Privacy . . . . . . . . . . . . . . . . . . . . . . . . . 30 98 6.3. Denial of Service . . . . . . . . . . . . . . . . . . . . 30 99 6.4. IdP Authentication Mechanism . . . . . . . . . . . . . . 31 100 6.4.1. PeerConnection Origin Check . . . . . . . . . . . . . 32 101 6.4.2. IdP Well-known URI . . . . . . . . . . . . . . . . . 32 102 6.4.3. Privacy of IdP-generated identities and the hosting 103 site . . . . . . . . . . . . . . . . . . . . . . . . 32 104 6.4.4. Security of Third-Party IdPs . . . . . . . . . . . . 33 105 6.4.5. Web Security Feature Interactions . . . . . . . . . . 33 106 6.4.5.1. Popup Blocking . . . . . . . . . . . . . . . . . 33 107 6.4.5.2. Third Party Cookies . . . . . . . . . . . . . . . 33 108 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 109 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 34 110 9. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 111 9.1. Changes since -10 . . . . . . . . . . . . . . . . . . . . 34 112 9.2. Changes since -06 . . . . . . . . . . . . . . . . . . . . 34 113 9.3. Changes since -05 . . . . . . . . . . . . . . . . . . . . 35 114 9.4. Changes since -03 . . . . . . . . . . . . . . . . . . . . 35 115 9.5. Changes since -03 . . . . . . . . . . . . . . . . . . . . 35 116 9.6. Changes since -02 . . . . . . . . . . . . . . . . . . . . 35 117 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 36 118 10.1. Normative References . . . . . . . . . . . . . . . . . . 36 119 10.2. Informative References . . . . . . . . . . . . . . . . . 38 120 Appendix A. Example IdP Bindings to Specific Protocols . . . . . 38 121 A.1. BrowserID . . . . . . . . . . . . . . . . . . . . . . . . 39 122 A.2. OAuth . . . . . . . . . . . . . . . . . . . . . . . . . . 42 123 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 43 125 1. Introduction 127 The Real-Time Communications on the Web (WebRTC) working group is 128 tasked with standardizing protocols for real-time communications 129 between Web browsers. The major use cases for WebRTC technology are 130 real-time audio and/or video calls, Web conferencing, and direct data 131 transfer. Unlike most conventional real-time systems, (e.g., SIP- 132 based[RFC3261] soft phones) WebRTC communications are directly 133 controlled by some Web server, via a JavaScript (JS) API as shown in 134 Figure 1. 136 +----------------+ 137 | | 138 | Web Server | 139 | | 140 +----------------+ 141 ^ ^ 142 / \ 143 HTTP / \ HTTP 144 / \ 145 / \ 146 v v 147 JS API JS API 148 +-----------+ +-----------+ 149 | | Media | | 150 | Browser |<---------->| Browser | 151 | | | | 152 +-----------+ +-----------+ 154 Figure 1: A simple WebRTC system 156 A more complicated system might allow for interdomain calling, as 157 shown in Figure 2. The protocol to be used between the domains is 158 not standardized by WebRTC, but given the installed base and the form 159 of the WebRTC API is likely to be something SDP-based like SIP. 161 +--------------+ +--------------+ 162 | | SIP,XMPP,...| | 163 | Web Server |<----------->| Web Server | 164 | | | | 165 +--------------+ +--------------+ 166 ^ ^ 167 | | 168 HTTP | | HTTP 169 | | 170 v v 171 JS API JS API 172 +-----------+ +-----------+ 173 | | Media | | 174 | Browser |<---------------->| Browser | 175 | | | | 176 +-----------+ +-----------+ 178 Figure 2: A multidomain WebRTC system 180 This system presents a number of new security challenges, which are 181 analyzed in [I-D.ietf-rtcweb-security]. This document describes a 182 security architecture for WebRTC which addresses the threats and 183 requirements described in that document. 185 2. Terminology 187 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 188 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 189 document are to be interpreted as described in RFC 2119 [RFC2119]. 191 3. Trust Model 193 The basic assumption of this architecture is that network resources 194 exist in a hierarchy of trust, rooted in the browser, which serves as 195 the user's TRUSTED COMPUTING BASE (TCB). Any security property which 196 the user wishes to have enforced must be ultimately guaranteed by the 197 browser (or transitively by some property the browser verifies). 198 Conversely, if the browser is compromised, then no security 199 guarantees are possible. Note that there are cases (e.g., Internet 200 kiosks) where the user can't really trust the browser that much. In 201 these cases, the level of security provided is limited by how much 202 they trust the browser. 204 Optimally, we would not rely on trust in any entities other than the 205 browser. However, this is unfortunately not possible if we wish to 206 have a functional system. Other network elements fall into two 207 categories: those which can be authenticated by the browser and thus 208 are partly trusted--though to the minimum extent necessary--and those 209 which cannot be authenticated and thus are untrusted. 211 3.1. Authenticated Entities 213 There are two major classes of authenticated entities in the system: 215 o Calling services: Web sites whose origin we can verify (optimally 216 via HTTPS, but in some cases because we are on a topologically 217 restricted network, such as behind a firewall, and can infer 218 authentication from firewall behavior). 220 o Other users: WebRTC peers whose origin we can verify 221 cryptographically (optimally via DTLS-SRTP). 223 Note that merely being authenticated does not make these entities 224 trusted. For instance, just because we can verify that 225 https://www.evil.org/ is owned by Dr. Evil does not mean that we can 226 trust Dr. Evil to access our camera and microphone. However, it 227 gives the user an opportunity to determine whether he wishes to trust 228 Dr. Evil or not; after all, if he desires to contact Dr. Evil 229 (perhaps to arrange for ransom payment), it's safe to temporarily 230 give him access to the camera and microphone for the purpose of the 231 call, but he doesn't want Dr. Evil to be able to access his camera 232 and microphone other than during the call. The point here is that we 233 must first identify other elements before we can determine whether 234 and how much to trust them. Additionally, sometimes we need to 235 identify the communicating peer before we know what policies to 236 apply. 238 It's also worth noting that there are settings where authentication 239 is non-cryptographic, such as other machines behind a firewall. 240 Naturally, the level of trust one can have in identities verified in 241 this way depends on how strong the topology enforcement is. 243 3.2. Unauthenticated Entities 245 Other than the above entities, we are not generally able to identify 246 other network elements, thus we cannot trust them. This does not 247 mean that it is not possible to have any interaction with them, but 248 it means that we must assume that they will behave maliciously and 249 design a system which is secure even if they do so. 251 4. Overview 253 This section describes a typical WebRTC session and shows how the 254 various security elements interact and what guarantees are provided 255 to the user. The example in this section is a "best case" scenario 256 in which we provide the maximal amount of user authentication and 257 media privacy with the minimal level of trust in the calling service. 258 Simpler versions with lower levels of security are also possible and 259 are noted in the text where applicable. It's also important to 260 recognize the tension between security (or performance) and privacy. 261 The example shown here is aimed towards settings where we are more 262 concerned about secure calling than about privacy, but as we shall 263 see, there are settings where one might wish to make different 264 tradeoffs--this architecture is still compatible with those settings. 266 For the purposes of this example, we assume the topology shown in the 267 figures below. This topology is derived from the topology shown in 268 Figure 1, but separates Alice and Bob's identities from the process 269 of signaling. Specifically, Alice and Bob have relationships with 270 some Identity Provider (IdP) that supports a protocol such as OpenID 271 or BrowserID) that can be used to demonstrate their identity to other 272 parties. For instance, Alice might have an account with a social 273 network which she can then use to authenticate to other web sites 274 without explicitly having an account with those sites; this is a 275 fairly conventional pattern on the Web. Section 5.6.1 provides an 276 overview of Identity Providers and the relevant terminology. Alice 277 and Bob might have relationships with different IdPs as well. 279 This separation of identity provision and signaling isn't 280 particularly important in "closed world" cases where Alice and Bob 281 are users on the same social network and have identities based on 282 that domain (Figure 3) However, there are important settings where 283 that is not the case, such as federation (calls from one domain to 284 another; Figure 4) and calling on untrusted sites, such as where two 285 users who have a relationship via a given social network want to call 286 each other on another, untrusted, site, such as a poker site. 288 Note that the servers themselves are also authenticated by an 289 external identity service, the SSL/TLS certificate infrastructure 290 (not shown). As is conventional in the Web, all identities are 291 ultimately rooted in that system. For instance, when an IdP makes an 292 identity assertion, the Relying Party consuming that assertion is 293 able to verify because it is able to connect to the IdP via HTTPS. 295 +----------------+ 296 | | 297 | Signaling | 298 | Server | 299 | | 300 +----------------+ 301 ^ ^ 302 / \ 303 HTTPS / \ HTTPS 304 / \ 305 / \ 306 v v 307 JS API JS API 308 +-----------+ +-----------+ 309 | | Media | | 310 Alice | Browser |<---------->| Browser | Bob 311 | | (DTLS+SRTP)| | 312 +-----------+ +-----------+ 313 ^ ^--+ +--^ ^ 314 | | | | 315 v | | v 316 +-----------+ | | +-----------+ 317 | |<--------+ | | 318 | IdP1 | | | IdP2 | 319 | | +------->| | 320 +-----------+ +-----------+ 322 Figure 3: A call with IdP-based identity 324 Figure 4 shows essentially the same calling scenario but with a call 325 between two separate domains (i.e., a federated case), as in 326 Figure 2. As mentioned above, the domains communicate by some 327 unspecified protocol and providing separate signaling and identity 328 allows for calls to be authenticated regardless of the details of the 329 inter-domain protocol. 331 +----------------+ Unspecified +----------------+ 332 | | protocol | | 333 | Signaling |<----------------->| Signaling | 334 | Server | (SIP, XMPP, ...) | Server | 335 | | | | 336 +----------------+ +----------------+ 337 ^ ^ 338 | | 339 HTTPS | | HTTPS 340 | | 341 | | 342 v v 343 JS API JS API 344 +-----------+ +-----------+ 345 | | Media | | 346 Alice | Browser |<--------------------------->| Browser | Bob 347 | | DTLS+SRTP | | 348 +-----------+ +-----------+ 349 ^ ^--+ +--^ ^ 350 | | | | 351 v | | v 352 +-----------+ | | +-----------+ 353 | |<-------------------------+ | | 354 | IdP1 | | | IdP2 | 355 | | +------------------------>| | 356 +-----------+ +-----------+ 358 Figure 4: A federated call with IdP-based identity 360 4.1. Initial Signaling 362 For simplicity, assume the topology in Figure 3. Alice and Bob are 363 both users of a common calling service; they both have approved the 364 calling service to make calls (we defer the discussion of device 365 access permissions till later). They are both connected to the 366 calling service via HTTPS and so know the origin with some level of 367 confidence. They also have accounts with some identity provider. 368 This sort of identity service is becoming increasingly common in the 369 Web environment (with technologies such as BrowserID, Federated 370 Google Login, Facebook Connect, OAuth, OpenID, WebFinger), and is 371 often provided as a side effect service of a user's ordinary accounts 372 with some service. In this example, we show Alice and Bob using a 373 separate identity service, though the identity service may be the 374 same entity as the calling service or there may be no identity 375 service at all. 377 Alice is logged onto the calling service and decides to call Bob. 378 She can see from the calling service that he is online and the 379 calling service presents a JS UI in the form of a button next to 380 Bob's name which says "Call". Alice clicks the button, which 381 initiates a JS callback that instantiates a PeerConnection object. 382 This does not require a security check: JS from any origin is allowed 383 to get this far. 385 Once the PeerConnection is created, the calling service JS needs to 386 set up some media. Because this is an audio/video call, it creates a 387 MediaStream with two MediaStreamTracks, one connected to an audio 388 input and one connected to a video input. At this point the first 389 security check is required: untrusted origins are not allowed to 390 access the camera and microphone, so the browser prompts Alice for 391 permission. 393 In the current W3C API, once some streams have been added, Alice's 394 browser + JS generates a signaling message [I-D.ietf-rtcweb-jsep] 395 containing: 397 o Media channel information 399 o Interactive Connectivity Establishment (ICE) [RFC5245] candidates 401 o A fingerprint attribute binding the communication to a key pair 402 [RFC5763]. Note that this key may simply be ephemerally generated 403 for this call or specific to this domain, and Alice may have a 404 large number of such keys. 406 Prior to sending out the signaling message, the PeerConnection code 407 contacts the identity service and obtains an assertion binding 408 Alice's identity to her fingerprint. The exact details depend on the 409 identity service (though as discussed in Section 5.6 PeerConnection 410 can be agnostic to them), but for now it's easiest to think of as a 411 BrowserID assertion. The assertion may bind other information to the 412 identity besides the fingerprint, but at minimum it needs to bind the 413 fingerprint. 415 This message is sent to the signaling server, e.g., by XMLHttpRequest 416 [XmlHttpRequest] or by WebSockets [RFC6455]. preferably over TLS 417 [RFC5246]. The signaling server processes the message from Alice's 418 browser, determines that this is a call to Bob and sends a signaling 419 message to Bob's browser (again, the format is currently undefined). 420 The JS on Bob's browser processes it, and alerts Bob to the incoming 421 call and to Alice's identity. In this case, Alice has provided an 422 identity assertion and so Bob's browser contacts Alice's identity 423 provider (again, this is done in a generic way so the browser has no 424 specific knowledge of the IdP) to verify the assertion. This allows 425 the browser to display a trusted element in the browser chrome 426 indicating that a call is coming in from Alice. If Alice is in Bob's 427 address book, then this interface might also include her real name, a 428 picture, etc. The calling site will also provide some user interface 429 element (e.g., a button) to allow Bob to answer the call, though this 430 is most likely not part of the trusted UI. 432 If Bob agrees a PeerConnection is instantiated with the message from 433 Alice's side. Then, a similar process occurs as on Alice's browser: 434 Bob's browser prompts him for device permission, the media streams 435 are created, and a return signaling message containing media 436 information, ICE candidates, and a fingerprint is sent back to Alice 437 via the signaling service. If Bob has a relationship with an IdP, 438 the message will also come with an identity assertion. 440 At this point, Alice and Bob each know that the other party wants to 441 have a secure call with them. Based purely on the interface provided 442 by the signaling server, they know that the signaling server claims 443 that the call is from Alice to Bob. This level of security is 444 provided merely by having the fingerprint in the message and having 445 that message received securely from the signaling server. Because 446 the far end sent an identity assertion along with their message, they 447 know that this is verifiable from the IdP as well. Note that if the 448 call is federated, as shown in Figure 4 then Alice is able to verify 449 Bob's identity in a way that is not mediated by either her signaling 450 server or Bob's. Rather, she verifies it directly with Bob's IdP. 452 Of course, the call works perfectly well if either Alice or Bob 453 doesn't have a relationship with an IdP; they just get a lower level 454 of assurance. I.e., they simply have whatever information their 455 calling site claims about the caller/calllee's identity. Moreover, 456 Alice might wish to make an anonymous call through an anonymous 457 calling site, in which case she would of course just not provide any 458 identity assertion and the calling site would mask her identity from 459 Bob. 461 4.2. Media Consent Verification 463 As described in ([I-D.ietf-rtcweb-security]; Section 4.2) media 464 consent verification is provided via ICE. Thus, Alice and Bob 465 perform ICE checks with each other. At the completion of these 466 checks, they are ready to send non-ICE data. 468 At this point, Alice knows that (a) Bob (assuming he is verified via 469 his IdP) or someone else who the signaling service is claiming is Bob 470 is willing to exchange traffic with her and (b) that either Bob is at 471 the IP address which she has verified via ICE or there is an attacker 472 who is on-path to that IP address detouring the traffic. Note that 473 it is not possible for an attacker who is on-path between Alice and 474 Bob but not attached to the signaling service to spoof these checks 475 because they do not have the ICE credentials. Bob has the same 476 security guarantees with respect to Alice. 478 4.3. DTLS Handshake 480 Once the ICE checks have completed [more specifically, once some ICE 481 checks have completed], Alice and Bob can set up a secure channel or 482 channels. This is performed via DTLS [RFC4347] (for the data 483 channel) and DTLS-SRTP [RFC5763] keying for SRTP [RFC3711] for the 484 media channel and SCTP over DTLS [I-D.ietf-tsvwg-sctp-dtls-encaps] 485 for data channels. Specifically, Alice and Bob perform a DTLS 486 handshake on every channel which has been established by ICE. The 487 total number of channels depends on the amount of muxing; in the most 488 likely case we are using both RTP/RTCP mux and muxing multiple media 489 streams on the same channel, in which case there is only one DTLS 490 handshake. Once the DTLS handshake has completed, the keys are 491 exported [RFC5705] and used to key SRTP for the media channels. 493 At this point, Alice and Bob know that they share a set of secure 494 data and/or media channels with keys which are not known to any 495 third-party attacker. If Alice and Bob authenticated via their IdPs, 496 then they also know that the signaling service is not mounting a man- 497 in-the-middle attack on their traffic. Even if they do not use an 498 IdP, as long as they have minimal trust in the signaling service not 499 to perform a man-in-the-middle attack, they know that their 500 communications are secure against the signaling service as well 501 (i.e., that the signaling service cannot mount a passive attack on 502 the communications). 504 4.4. Communications and Consent Freshness 506 From a security perspective, everything from here on in is a little 507 anticlimactic: Alice and Bob exchange data protected by the keys 508 negotiated by DTLS. Because of the security guarantees discussed in 509 the previous sections, they know that the communications are 510 encrypted and authenticated. 512 The one remaining security property we need to establish is "consent 513 freshness", i.e., allowing Alice to verify that Bob is still prepared 514 to receive her communications so that Alice does not continue to send 515 large traffic volumes to entities which went abruptly offline. ICE 516 specifies periodic STUN keepalives but only if media is not flowing. 517 Because the consent issue is more difficult here, we require WebRTC 518 implementations to periodically send keepalives. As described in 519 Section 5.3, these keepalives MUST be based on the consent freshness 520 mechanism specified in [I-D.muthu-behave-consent-freshness]. If a 521 keepalive fails and no new ICE channels can be established, then the 522 session is terminated. 524 5. Detailed Technical Description 526 5.1. Origin and Web Security Issues 528 The basic unit of permissions for WebRTC is the origin [RFC6454]. 529 Because the security of the origin depends on being able to 530 authenticate content from that origin, the origin can only be 531 securely established if data is transferred over HTTPS [RFC2818]. 532 Thus, clients MUST treat HTTP and HTTPS origins as different 533 permissions domains. [Note: this follows directly from the origin 534 security model and is stated here merely for clarity.] 536 Many web browsers currently forbid by default any active mixed 537 content on HTTPS pages. That is, when JavaScript is loaded from an 538 HTTP origin onto an HTTPS page, an error is displayed and the HTTP 539 content is not executed unless the user overrides the error. Any 540 browser which enforces such a policy will also not permit access to 541 WebRTC functionality from mixed content pages (because they never 542 display mixed content). Browsers which allow active mixed content 543 MUST nevertheless disable WebRTC functionality in mixed content 544 settings. 546 Note that it is possible for a page which was not mixed content to 547 become mixed content during the duration of the call. The major risk 548 here is that the newly arrived insecure JS might redirect media to a 549 location controlled by the attacker. Implementations MUST either 550 choose to terminate the call or display a warning at that point. 552 5.2. Device Permissions Model 554 Implementations MUST obtain explicit user consent prior to providing 555 access to the camera and/or microphone. Implementations MUST at 556 minimum support the following two permissions models for HTTPS 557 origins. 559 o Requests for one-time camera/microphone access. 561 o Requests for permanent access. 563 Because HTTP origins cannot be securely established against network 564 attackers, implementations MUST NOT allow the setting of permanent 565 access permissions for HTTP origins. Implementations MAY also opt to 566 refuse all permissions grants for HTTP origins, but it is RECOMMENDED 567 that currently they support one-time camera/microphone access. 569 In addition, they SHOULD support requests for access that promise 570 that media from this grant will be sent to a single communicating 571 peer (obviously there could be other requests for other peers). 572 E.g., "Call customerservice@ford.com". The semantics of this request 573 are that the media stream from the camera and microphone will only be 574 routed through a connection which has been cryptographically verified 575 (through the IdP mechanism or an X.509 certificate in the DTLS-SRTP 576 handshake) as being associated with the stated identity. Note that 577 it is unlikely that browsers would have an X.509 certificate, but 578 servers might. Browsers servicing such requests SHOULD clearly 579 indicate that identity to the user when asking for permission. The 580 idea behind this type of permissions is that a user might have a 581 fairly narrow list of peers he is willing to communicate with, e.g., 582 "my mother" rather than "anyone on Facebook". Narrow permissions 583 grants allow the browser to do that enforcement. 585 API Requirement: The API MUST provide a mechanism for the requesting 586 JS to indicate which of these forms of permissions it is 587 requesting. This allows the browser client to know what sort of 588 user interface experience to provide to the user, including what 589 permissions to request from the user and hence what to enforce 590 later. For instance, browsers might display a non-invasive door 591 hanger ("some features of this site may not work..." when asking 592 for long-term permissions) but a more invasive UI ("here is your 593 own video") for single-call permissions. The API MAY grant weaker 594 permissions than the JS asked for if the user chooses to authorize 595 only those permissions, but if it intends to grant stronger ones 596 it SHOULD display the appropriate UI for those permissions and 597 MUST clearly indicate what permissions are being requested. 599 API Requirement: The API MUST provide a mechanism for the requesting 600 JS to relinquish the ability to see or modify the media (e.g., via 601 MediaStream.record()). Combined with secure authentication of the 602 communicating peer, this allows a user to be sure that the calling 603 site is not accessing or modifying their conversion. 605 UI Requirement: The UI MUST clearly indicate when the user's camera 606 and microphone are in use. This indication MUST NOT be 607 suppressable by the JS and MUST clearly indicate how to terminate 608 device access, and provide a UI means to immediately stop camera/ 609 microphone input without the JS being able to prevent it. 611 UI Requirement: If the UI indication of camera/microphone use are 612 displayed in the browser such that minimizing the browser window 613 would hide the indication, or the JS creating an overlapping 614 window would hide the indication, then the browser SHOULD stop 615 camera and microphone input when the indication is hidden. [Note: 617 this may not be necessary in systems that are non-windows-based 618 but that have good notifications support, such as phones.] 620 [[OPEN ISSUE: This section does not have WG consensus. Because 621 screen/application sharing presents a more significant risk than 622 camera and microphone access (see the discussion in 623 [I-D.ietf-rtcweb-security] S 4.1.1), we require a higher level of 624 user consent. 626 o Browsers MUST not permit permanent screen or application sharing 627 permissions to be installed as a response to a JS request for 628 permissions. Instead, they must require some other user action 629 such as a permissions setting or an application install experience 630 to grant permission to a site. 632 o Browsers MUST provide a separate dialog request for screen/ 633 application sharing permissions even if the media request is made 634 at the same time as camera and microphone. 636 o The browser MUST indicate any windows which are currently being 637 shared in some unambiguous way. Windows which are not visible 638 MUST not be shared even if the application is being shared. If 639 the screen is being shared, then that MUST be indicated. 641 -- END OF OPEN ISSUE]] 643 Clients MAY permit the formation of data channels without any direct 644 user approval. Because sites can always tunnel data through the 645 server, further restrictions on the data channel do not provide any 646 additional security. (though see Section 5.3 for a related issue). 648 Implementations which support some form of direct user authentication 649 SHOULD also provide a policy by which a user can authorize calls only 650 to specific communicating peers. Specifically, the implementation 651 SHOULD provide the following interfaces/controls: 653 o Allow future calls to this verified user. 655 o Allow future calls to any verified user who is in my system 656 address book (this only works with address book integration, of 657 course). 659 Implementations SHOULD also provide a different user interface 660 indication when calls are in progress to users whose identities are 661 directly verifiable. Section 5.5 provides more on this. 663 5.3. Communications Consent 665 Browser client implementations of WebRTC MUST implement ICE. Server 666 gateway implementations which operate only at public IP addresses 667 MUST implement either full ICE or ICE-Lite [RFC5245]. 669 Browser implementations MUST verify reachability via ICE prior to 670 sending any non-ICE packets to a given destination. Implementations 671 MUST NOT provide the ICE transaction ID to JavaScript during the 672 lifetime of the transaction (i.e., during the period when the ICE 673 stack would accept a new response for that transaction). The JS MUST 674 NOT be permitted to control the local ufrag and password, though it 675 of course knows it. 677 While continuing consent is required, the ICE [RFC5245]; Section 10 678 keepalives use STUN Binding Indications which are one-way and 679 therefore not sufficient. The current WG consensus is to use ICE 680 Binding Requests for continuing consent freshness. ICE already 681 requires that implementations respond to such requests, so this 682 approach is maximally compatible. A separate document will profile 683 the ICE timers to be used; see [I-D.muthu-behave-consent-freshness]. 685 5.4. IP Location Privacy 687 A side effect of the default ICE behavior is that the peer learns 688 one's IP address, which leaks large amounts of location information. 689 This has negative privacy consequences in some circumstances. The 690 API requirements in this section are intended to mitigate this issue. 691 Note that these requirements are NOT intended to protect the user's 692 IP address from a malicious site. In general, the site will learn at 693 least a user's server reflexive address from any HTTP transaction. 694 Rather, these requirements are intended to allow a site to cooperate 695 with the user to hide the user's IP address from the other side of 696 the call. Hiding the user's IP address from the server requires some 697 sort of explicit privacy preserving mechanism on the client (e.g., 698 Torbutton [https://www.torproject.org/torbutton/]) and is out of 699 scope for this specification. 701 API Requirement: The API MUST provide a mechanism to allow the JS to 702 suppress ICE negotiation (though perhaps to allow candidate 703 gathering) until the user has decided to answer the call [note: 704 determining when the call has been answered is a question for the 705 JS.] This enables a user to prevent a peer from learning their IP 706 address if they elect not to answer a call and also from learning 707 whether the user is online. 709 API Requirement: The API MUST provide a mechanism for the calling 710 application JS to indicate that only TURN candidates are to be 711 used. This prevents the peer from learning one's IP address at 712 all. This mechanism MUST also permit suppression of the related 713 address field, since that leaks local addresses. 715 API Requirement: The API MUST provide a mechanism for the calling 716 application to reconfigure an existing call to add non-TURN 717 candidates. Taken together, this and the previous requirement 718 allow ICE negotiation to start immediately on incoming call 719 notification, thus reducing post-dial delay, but also to avoid 720 disclosing the user's IP address until they have decided to 721 answer. They also allow users to completely hide their IP address 722 for the duration of the call. Finally, they allow a mechanism for 723 the user to optimize performance by reconfiguring to allow non- 724 turn candidates during an active call if the user decides they no 725 longer need to hide their IP address 727 Note that some enterprises may operate proxies and/or NATs designed 728 to hide internal IP addresses from the outside world. WebRTC 729 provides no explicit mechanism to allow this function. Either such 730 enterprises need to proxy the HTTP/HTTPS and modify the SDP and/or 731 the JS, or there needs to be browser support to set the "TURN-only" 732 policy regardless of the site's preferences. 734 5.5. Communications Security 736 Implementations MUST implement SRTP [RFC3711]. Implementations MUST 737 implement DTLS [RFC4347] and DTLS-SRTP [RFC5763][RFC5764] for SRTP 738 keying. Implementations MUST implement 739 [I-D.ietf-tsvwg-sctp-dtls-encaps]. 741 All media channels MUST be secured via SRTP. Media traffic MUST NOT 742 be sent over plain (unencrypted) RTP; that is, implementations MUST 743 NOT negotiate cipher suites with NULL encryption modes. DTLS-SRTP 744 MUST be offered for every media channel. WebRTC implementations MUST 745 NOT offer SDES or select it if offered. 747 All data channels MUST be secured via DTLS. 749 All implementations MUST implement DTLS 1.0, with the cipher suite 750 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA and the DTLS-SRTP protection 751 profile SRTP_AES128_CM_HMAC_SHA1_80. Implementations SHOULD 752 implement DTLS 1.2 with the TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 753 cipher suite. Implementations SHOULD favor cipher suites which 754 support PFS over non-PFS cipher suites and GCM over CBC cipher 755 suites. [[OPEN ISSUE: Should we require ECDSA? Waiting for WG 756 Consensus.]] 757 API Requirement: The API MUST provide a mechanism to indicate that a 758 fresh DTLS key pair is to be generated for a specific call. This 759 is intended to allow for unlinkability. Note that there are also 760 settings where it is attractive to use the same keying material 761 repeatedly, especially those with key continuity-based 762 authentication. Unless the user specifically configures an 763 external key pair, different key pairs MUST be used for each 764 origin. (This avoids creating a super-cookie.) 766 API Requirement: When DTLS-SRTP is used, the API MUST NOT permit the 767 JS to obtain the negotiated keying material. This requirement 768 preserves the end-to-end security of the media. 770 UI Requirements: A user-oriented client MUST provide an "inspector" 771 interface which allows the user to determine the security 772 characteristics of the media. 774 The following properties SHOULD be displayed "up-front" in the 775 browser chrome, i.e., without requiring the user to ask for them: 777 * A client MUST provide a user interface through which a user may 778 determine the security characteristics for currently-displayed 779 audio and video stream(s) 781 * A client MUST provide a user interface through which a user may 782 determine the security characteristics for transmissions of 783 their microphone audio and camera video. 785 * The "security characteristics" MUST include an indication as to 786 whether the cryptographic keys were delivered out-of-band (from 787 a server) or were generated as a result of a pairwise 788 negotiation. 790 * If the far endpoint was directly verified, either via a third- 791 party verifiable X.509 certificate or via a Web IdP mechanism 792 (see Section 5.6) the "security characteristics" MUST include 793 the verified information. X.509 identities and Web IdP 794 identities have similar semantics and should be displayed in a 795 similar way. 797 The following properties are more likely to require some "drill- 798 down" from the user: 800 * The "security characteristics" MUST indicate the cryptographic 801 algorithms in use (For example: "AES-CBC" or "Null Cipher".) 802 However, if Null ciphers are used, that MUST be presented to 803 the user at the top-level UI. 805 * The "security characteristics" MUST indicate whether PFS is 806 provided. 808 * The "security characteristics" MUST include some mechanism to 809 allow an out-of-band verification of the peer, such as a 810 certificate fingerprint or an SAS. 812 5.6. Web-Based Peer Authentication 814 In a number of cases, it is desirable for the endpoint (i.e., the 815 browser) to be able to directly identify the endpoint on the other 816 side without trusting the signaling service to which they are 817 connected. For instance, users may be making a call via a federated 818 system where they wish to get direct authentication of the other 819 side. Alternately, they may be making a call on a site which they 820 minimally trust (such as a poker site) but to someone who has an 821 identity on a site they do trust (such as a social network.) 823 Recently, a number of Web-based identity technologies (OAuth, 824 BrowserID, Facebook Connect etc.) have been developed. While the 825 details vary, what these technologies share is that they have a Web- 826 based (i.e., HTTP/HTTPS) identity provider which attests to your 827 identity. For instance, if I have an account at example.org, I could 828 use the example.org identity provider to prove to others that I was 829 alice@example.org. The development of these technologies allows us 830 to separate calling from identity provision: I could call you on 831 Poker Galaxy but identify myself as alice@example.org. 833 Whatever the underlying technology, the general principle is that the 834 party which is being authenticated is NOT the signaling site but 835 rather the user (and their browser). Similarly, the relying party is 836 the browser and not the signaling site. Thus, the browser MUST 837 securely generate the input to the IdP assertion process and MUST 838 securely display the results of the verification process to the user 839 in a way which cannot be imitated by the calling site. 841 The mechanisms defined in this document do not require the browser to 842 implement any particular identity protocol or to support any 843 particular IdP. Instead, this document provides a generic interface 844 which any IdP can implement. Thus, new IdPs and protocols can be 845 introduced without change to either the browser or the calling 846 service. This avoids the need to make a commitment to any particular 847 identity protocol, although browsers may opt to directly implement 848 some identity protocols in order to provide superior performance or 849 UI properties. 851 5.6.1. Trust Relationships: IdPs, APs, and RPs 853 Any federated identity protocol has three major participants: 855 Authenticating Party (AP): The entity which is trying to establish 856 its identity. 858 Identity Provider (IdP): The entity which is vouching for the AP's 859 identity. 861 Relying Party (RP): The entity which is trying to verify the AP's 862 identity. 864 The AP and the IdP have an account relationship of some kind: the AP 865 registers with the IdP and is able to subsequently authenticate 866 directly to the IdP (e.g., with a password). This means that the 867 browser must somehow know which IdP(s) the user has an account 868 relationship with. This can either be something that the user 869 configures into the browser or that is configured at the calling site 870 and then provided to the PeerConnection by the Web application at the 871 calling site. The use case for having this information configured 872 into the browser is that the user may "log into" the browser to bind 873 it to some identity. This is becoming common in new browsers. 874 However, it should also be possible for the IdP information to simply 875 be provided by the calling application. 877 At a high level there are two kinds of IdPs: 879 Authoritative: IdPs which have verifiable control of some section 880 of the identity space. For instance, in the realm of e-mail, the 881 operator of "example.com" has complete control of the namespace 882 ending in "@example.com". Thus, "alice@example.com" is whoever 883 the operator says it is. Examples of systems with authoritative 884 identity providers include DNSSEC, RFC 4474, and Facebook Connect 885 (Facebook identities only make sense within the context of the 886 Facebook system). 888 Third-Party: IdPs which don't have control of their section of the 889 identity space but instead verify user's identities via some 890 unspecified mechanism and then attest to it. Because the IdP 891 doesn't actually control the namespace, RPs need to trust that the 892 IdP is correctly verifying AP identities, and there can 893 potentially be multiple IdPs attesting to the same section of the 894 identity space. Probably the best-known example of a third-party 895 identity provider is SSL certificates, where there are a large 896 number of CAs all of whom can attest to any domain name. 898 If an AP is authenticating via an authoritative IdP, then the RP does 899 not need to explicitly configure trust in the IdP at all. The 900 identity mechanism can directly verify that the IdP indeed made the 901 relevant identity assertion (a function provided by the mechanisms in 902 this document), and any assertion it makes about an identity for 903 which it is authoritative is directly verifiable. Note that this 904 does not mean that the IdP might not lie, but that is a 905 trustworthiness judgement that the user can make at the time he looks 906 at the identity. 908 By contrast, if an AP is authenticating via a third-party IdP, the RP 909 needs to explicitly trust that IdP (hence the need for an explicit 910 trust anchor list in PKI-based SSL/TLS clients). The list of 911 trustable IdPs needs to be configured directly into the browser, 912 either by the user or potentially by the browser manufacturer. This 913 is a significant advantage of authoritative IdPs and implies that if 914 third-party IdPs are to be supported, the potential number needs to 915 be fairly small. 917 5.6.2. Overview of Operation 919 In order to provide security without trusting the calling site, the 920 PeerConnection component of the browser must interact directly with 921 the IdP. The details of the mechanism are described in the W3C API 922 specification, but the general idea is that the PeerConnection 923 component downloads JS from a specific location on the IdP dictated 924 by the IdP domain name. That JS (the "IdP proxy") runs in an 925 isolated security context within the browser and the PeerConnection 926 talks to it via a secure message passing channel. 928 Note that there are two logically separate functions here: 930 o Identity assertion generation. 932 o Identity assertion verification. 934 The same IdP JS "endpoint" is used for both functions but of course a 935 given IdP might behave differently and load new JS to perform one 936 function or the other. 938 +--------------------------------------+ 939 | Browser | 940 | | 941 | +----------------------------------+ | 942 | | https://calling-site.example.com | | 943 | | | | 944 | | Calling JS Code | | 945 | | ^ | | 946 | +---------------|------------------+ | 947 | | API Calls | 948 | v | 949 | PeerConnection | 950 | ^ | 951 | | API Calls | 952 | +-----------|-------------+ | +---------------+ 953 | | v | | | | 954 | | IdP Proxy |<-------->| Identity | 955 | | | | | Provider | 956 | | https://idp.example.org | | | | 957 | +-------------------------+ | +---------------+ 958 | | 959 +--------------------------------------+ 961 When the PeerConnection object wants to interact with the IdP, the 962 sequence of events is as follows: 964 1. The browser (the PeerConnection component) instantiates an IdP 965 proxy. This allows the IdP to load whatever JS is necessary into 966 the proxy. The resulting code runs in the IdP's security 967 context. 969 2. The IdP registers an object with the browser that conforms to the 970 API defined in [webrtc-api]. 972 3. The browser invokes methods on the object registered by the IdP 973 proxy to create or verify identity assertions. 975 This approach allows us to decouple the browser from any particular 976 identity provider; the browser need only know how to load the IdP's 977 JavaScript--the location of which is determined based on the IdP's 978 identity--and to call the generic API for requesting and verifying 979 identity assertions. The IdP provides whatever logic is necessary to 980 bridge the generic protocol to the IdP's specific requirements. 981 Thus, a single browser can support any number of identity protocols, 982 including being forward compatible with IdPs which did not exist at 983 the time the browser was written. 985 5.6.3. Items for Standardization 987 There are two parts to this work: 989 o The precise information from the signaling message that must be 990 cryptographically bound to the user's identity and a mechanism for 991 carrying assertions in JSEP messages. This is specified in 992 Section 5.6.4. 994 o The interface to the IdP, which is defined in the companion W3C 995 WebRTC API specification [webrtc-api]. 997 The WebRTC API specification also defines JavaScript interfaces that 998 the calling application can use to specify which IdP to use. That 999 API also provides access to the assertion-generation capability and 1000 the status of the validation process. 1002 5.6.4. Binding Identity Assertions to JSEP Offer/Answer Transactions 1004 An identity assertion binds the user's identity (as asserted by the 1005 IdP) to the SDP offer/exchange transaction and specifically to the 1006 media. In order to achieve this, the PeerConnection must provide the 1007 DTLS-SRTP fingerprint to be bound to the identity. This is provided 1008 as a JavaScript object (also known as a dictionary or hash) with a 1009 single "fingerprint" key, as shown below: 1011 { 1012 "fingerprint": [ { 1013 "algorithm": "sha-256", 1014 "digest": "4A:AD:B9:B1:3F:...:E5:7C:AB" 1015 }, { 1016 "algorithm": "sha-1", 1017 "digest": "74:E9:76:C8:19:...:F4:45:6B" 1018 } ] 1019 } 1021 The "fingerprint" value is an array of objects. Each object in the 1022 array contains "algorithm" and "digest" values, which correspond 1023 directly to the algorithm and digest values in the "a=fingerprint" 1024 line of the SDP [RFC4572]. 1026 This object is encoded in a JSON [RFC4627] string for passing to the 1027 IdP. 1029 This structure does not need to be interpreted by the IdP or the IdP 1030 proxy. It is consumed solely by the RP's browser. The IdP merely 1031 treats it as an opaque value to be attested to. Thus, new parameters 1032 can be added to the assertion without modifying the IdP. 1034 5.6.4.1. Carrying Identity Assertions 1036 Once an IdP has generated an assertion, it is attached to the SDP 1037 message. This is done by adding a new identity attribute to the SDP. 1038 The sole contents of this value are a base-64 encoded [RFC4648] 1039 identity assertion. For example: 1041 v=0 1042 o=- 1181923068 1181923196 IN IP4 ua1.example.com 1043 s=example1 1044 c=IN IP4 ua1.example.com 1045 a=fingerprint:sha-1 \ 1046 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 1047 a=identity:\ 1048 eyJpZHAiOnsiZG9tYWluIjoiZXhhbXBsZS5vcmciLCJwcm90b2NvbCI6ImJvZ3Vz\ 1049 In0sImFzc2VydGlvbiI6IntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5vcmdc\ 1050 IixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIsXCJz\ 1051 aWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9 1052 a=... 1053 t=0 0 1054 m=audio 6056 RTP/SAVP 0 1055 a=sendrecv 1056 ... 1058 The identity attribute attests to all "a=fingerprint" attributes in 1059 the session description. It is therefore a session-level attribute. 1061 Multiple "a=fingerprint" values can be used to offer alternative 1062 certificates for a peer. The "a=identity" attribute MUST include all 1063 fingerprint values that are included in "a=fingerprint" lines. 1065 The RP browser MUST verify that the in-use certificate for a DTLS 1066 connection is in the set of fingerprints returned from the IdP when 1067 verifying an assertion. 1069 5.6.4.2. a=identity Attribute 1071 The identity attribute is session level only. It contains an 1072 identity assertion, encoded as a base-64 string [RFC4648]. 1074 The syntax of this SDP attribute is defined using Augmented BNF 1075 [RFC5234]: 1077 identity-attribute = "identity:" identity-assertion 1078 [ SP identity-extension 1079 *(";" [ SP ] identity-extension) ] 1080 identity-assertion = base64 1081 base64 = 1*(ALPHA / DIGIT / "+" / "/" / "=" ) 1082 identity-extension = extension-att-name [ "=" extension-att-value ] 1083 extension-att-name = token 1084 extension-att-value = 1*(%x01-09 / %x0b-0c / %x0e-3a / %x3c-ff) 1085 ; byte-string from [RFC4566] omitting ";" 1087 No extensions are defined for this attribute. 1089 The identity assertion is a JSON [RFC4627] encoded dictionary that 1090 contains two values. The "assertion" attribute contains an opaque 1091 string that is consumed by the IdP. The "idp" attribute is a 1092 dictionary with one or two further values that identify the IdP, as 1093 described in Section 5.6.5. 1095 5.6.5. Determining the IdP URI 1097 In order to ensure that the IdP is under control of the domain owner 1098 rather than someone who merely has an account on the domain owner's 1099 server (e.g., in shared hosting scenarios), the IdP JavaScript is 1100 hosted at a deterministic location based on the IdP's domain name. 1101 Each IdP proxy instance is associated with two values: 1103 domain name: The IdP's domain name 1105 protocol: The specific IdP protocol which the IdP is using. This is 1106 a completely opaque IdP-specific string, but allows an IdP to 1107 implement two protocols in parallel. This value may be the empty 1108 string. If no value for protocol is provided, a value of 1109 "default" is used. 1111 Each IdP MUST serve its initial entry page (i.e., the one loaded by 1112 the IdP proxy) from a well-known URI [RFC5785]. The well-known URI 1113 for an IdP proxy is formed from the following URI components: 1115 1. The scheme, "https:". An IdP MUST be loaded using HTTPS 1116 [RFC2818]. 1118 2. The authority, which is the IdP domain name. The authority MAY 1119 contain a non-default port number. Any port number is removed 1120 when determining if an asserted identity matches the name of the 1121 IdP. The authority MUST NOT include a userinfo sub-component. 1123 3. The path, starting with "/.well-known/idp-proxy/" and appended 1124 with the IdP protocol. Note that the separator characters '/' 1125 (%2F) and '\' (%5C) MUST NOT be permitted in the protocol field, 1126 lest an attacker be able to direct requests outside of the 1127 controlled "/.well-known/" prefix. Query and fragment values MAY 1128 be used by including '?' or '#' characters. 1130 For example, for the IdP "identity.example.com" and the protocol 1131 "example", the URL would be: 1133 https://example.com/.well-known/idp-proxy/example 1135 The IdP MAY redirect requests to this URL, but they MUST retain the 1136 "https" scheme. This changes the effective origin of the IdP, but 1137 not the domain of the identities that the IdP is permitted to assert 1138 and validate. I.e., the IdP is still regarded as authoritative for 1139 the original domain. 1141 5.6.5.1. Authenticating Party 1143 How an AP determines the appropriate IdP domain is out of scope of 1144 this specification. In general, however, the AP has some actual 1145 account relationship with the IdP, as this identity is what the IdP 1146 is attesting to. Thus, the AP somehow supplies the IdP information 1147 to the browser. Some potential mechanisms include: 1149 o Provided by the user directly. 1151 o Selected from some set of IdPs known to the calling site. E.g., a 1152 button that shows "Authenticate via Facebook Connect" 1154 5.6.5.2. Relying Party 1156 Unlike the AP, the RP need not have any particular relationship with 1157 the IdP. Rather, it needs to be able to process whatever assertion 1158 is provided by the AP. As the assertion contains the IdP's identity, 1159 the URI can be constructed directly from the assertion, and thus the 1160 RP can directly verify the technical validity of the assertion with 1161 no user interaction. Authoritative assertions need only be 1162 verifiable. Third-party assertions also MUST be verified against 1163 local policy, as described in Section 5.7.1. 1165 5.6.6. Requesting Assertions 1167 The input to identity assertion is the JSON-encoded object described 1168 in Section 5.6.4 that contains the set of certificate fingerprints 1169 the browser intends to use. This string is treated as opaque from 1170 the perspective of the IdP. 1172 The browser also identifies the origin that the PeerConnection is run 1173 in, which allows the IdP to make decisions based on who is requesting 1174 the assertion. 1176 An application can optionally provide a user identifier hint when 1177 specifying an IdP. This value is a hint that the IdP can use to 1178 select amongst multiple identities, or to avoid providing assertions 1179 for unwanted identities. The "username" is a string that has no 1180 meaning to any entity other than the IdP, it can contain any data the 1181 IdP needs in order to correctly generate an assertion. 1183 An identity assertion that is successfully provided by the IdP 1184 consists of the following information: 1186 idp: The domain name of an IdP and the protocol string. This MAY 1187 identify a different IdP or protocol from the one that generated 1188 the assertion. 1190 assertion: An opaque value containing the assertion itself. This is 1191 only interpretable by the identified IdP or the IdP code running 1192 in the client. 1194 Figure 5 shows an example assertion formatted as JSON. In this case, 1195 the message has presumably been digitally signed/MACed in some way 1196 that the IdP can later verify it, but this is an implementation 1197 detail and out of scope of this document. Line breaks are inserted 1198 solely for readability. 1200 { 1201 "idp":{ 1202 "domain": "example.org", 1203 "protocol": "bogus" 1204 }, 1205 "assertion": "{\"identity\":\"bob@example.org\", 1206 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1207 \"signature\":\"010203040506\"}" 1208 } 1210 Figure 5: Example assertion 1212 For use in signaling, the assertion is serialized into JSON, 1213 base64-encoded [RFC4648], and used as the value of the "a=identity" 1214 attribute. 1216 5.6.7. Managing User Login 1218 In order to generate an identity assertion, the IdP needs proof of 1219 the user's identity. It is common practice to authenticate users 1220 (using passwords or multi-factor authentication), then use Cookies 1221 [RFC6265] or HTTP authentication [RFC2617] for subsequent exchanges. 1223 The IdP proxy is able to access cookies, HTTP authentication or other 1224 persistent session data because it operates in the security context 1225 of the IdP origin. Therefore, if a user is logged in, the IdP could 1226 have all the information needed to generate an assertion. 1228 An IdP proxy is unable to generate an assertion if the user is not 1229 logged in, or the IdP wants to interact with the user to acquire more 1230 information before generating the assertion. If the IdP wants to 1231 interact with the user before generating an assertion, the IdP proxy 1232 can fail to generate an assertion and instead indicate a URL where 1233 login should proceed. 1235 The application can then load the provided URL to enable the user to 1236 enter credentials. The communication between the application and the 1237 IdP is described in [webrtc-api]. 1239 5.7. Verifying Assertions 1241 The input to identity validation is the assertion string taken from a 1242 decoded a=identity attribute. 1244 The IdP proxy verifies the assertion. Depending on the identity 1245 protocol, the proxy might contact the IdP server or other servers. 1246 For instance, an OAuth-based protocol will likely require using the 1247 IdP as an oracle, whereas with a signature-based scheme might be able 1248 to verify the assertion without contacting the IdP, provided that it 1249 has cached the relevant public key. 1251 Regardless of the mechanism, if verification succeeds, a successful 1252 response from the IdP proxy consists of the following information: 1254 identity: The identity of the AP from the IdP's perspective. 1255 Details of this are provided in Section 5.7.1. 1257 contents: The original unmodified string provided by the AP as input 1258 to the assertion generation process. 1260 Figure 6 shows an example response formatted as JSON for illustrative 1261 purposes. 1263 { 1264 "identity": "bob@example.org", 1265 "contents": "{\"fingerprint\":[ ... ]}" 1266 } 1268 Figure 6: Example verification result 1270 5.7.1. Identity Formats 1272 The identity provided from the IdP to the RP browser MUST consist of 1273 a string representing the user's identity. This string is in the 1274 form "@", where "user" consists of any character except 1275 '@', and domain is an internationalized domain name [RFC5890]. 1277 The PeerConnection API MUST check this string as follows: 1279 1. If the domain portion of the string is equal to the domain name 1280 of the IdP proxy, then the assertion is valid, as the IdP is 1281 authoritative for this domain. Comparison of domain names is 1282 done using the label equivalence rule defined in Section 2.3.2.4 1283 of [RFC5890]. 1285 2. If the domain portion of the string is not equal to the domain 1286 name of the IdP proxy, then the PeerConnection object MUST reject 1287 the assertion unless: 1289 1. the IdP domain is trusted as an acceptable third-party IdP; 1290 and 1292 2. local policy is configured to trust this IdP domain for the 1293 domain portion of the identity string. 1295 Sites that have identities that do not fit into the RFC822 style (for 1296 instance, identifiers that are simple numeric values, or values that 1297 contain '@' characters) SHOULD convert them to this form by escaping 1298 illegal characters and appending their IdP domain (e.g., 1299 user%40133@identity.example.com), thus ensuring that they are 1300 authoritative for the identity. 1302 6. Security Considerations 1304 Much of the security analysis of this problem is contained in 1305 [I-D.ietf-rtcweb-security] or in the discussion of the particular 1306 issues above. In order to avoid repetition, this section focuses on 1307 (a) residual threats that are not addressed by this document and (b) 1308 threats produced by failure/misbehavior of one of the components in 1309 the system. 1311 6.1. Communications Security 1313 While this document favors DTLS-SRTP, it permits a variety of 1314 communications security mechanisms and thus the level of 1315 communications security actually provided varies considerably. Any 1316 pair of implementations which have multiple security mechanisms in 1317 common are subject to being downgraded to the weakest of those common 1318 mechanisms by any attacker who can modify the signaling traffic. If 1319 communications are over HTTP, this means any on-path attacker. If 1320 communications are over HTTPS, this means the signaling server. 1321 Implementations which wish to avoid downgrade attack should only 1322 offer the strongest available mechanism, which is DTLS/DTLS-SRTP. 1323 Note that the implication of this choice will be that interop to non- 1324 DTLS-SRTP devices will need to happen through gateways. 1326 Even if only DTLS/DTLS-SRTP are used, the signaling server can 1327 potentially mount a man-in-the-middle attack unless implementations 1328 have some mechanism for independently verifying keys. The UI 1329 requirements in Section 5.5 are designed to provide such a mechanism 1330 for motivated/security conscious users, but are not suitable for 1331 general use. The identity service mechanisms in Section 5.6 are more 1332 suitable for general use. Note, however, that a malicious signaling 1333 service can strip off any such identity assertions, though it cannot 1334 forge new ones. Note that all of the third-party security mechanisms 1335 available (whether X.509 certificates or a third-party IdP) rely on 1336 the security of the third party--this is of course also true of your 1337 connection to the Web site itself. Users who wish to assure 1338 themselves of security against a malicious identity provider can only 1339 do so by verifying peer credentials directly, e.g., by checking the 1340 peer's fingerprint against a value delivered out of band. 1342 In order to protect against malicious content JavaScript, that 1343 JavaScript MUST NOT be allowed to have direct access to---or perform 1344 computations with---DTLS keys. For instance, if content JS were able 1345 to compute digital signatures, then it would be possible for content 1346 JS to get an identity assertion for a browser's generated key and 1347 then use that assertion plus a signature by the key to authenticate a 1348 call protected under an ephemeral DH key controlled by the content 1349 JS, thus violating the security guarantees otherwise provided by the 1350 IdP mechanism. Note that it is not sufficient merely to deny the 1351 content JS direct access to the keys, as some have suggested doing 1352 with the WebCrypto API. [webcrypto]. The JS must also not be 1353 allowed to perform operations that would be valid for a DTLS 1354 endpoint. By far the safest approach is simply to deny the ability 1355 to perform any operations that depend on secret information 1356 associated with the key. Operations that depend on public 1357 information, such as exporting the public key are of course safe. 1359 6.2. Privacy 1361 The requirements in this document are intended to allow: 1363 o Users to participate in calls without revealing their location. 1365 o Potential callees to avoid revealing their location and even 1366 presence status prior to agreeing to answer a call. 1368 However, these privacy protections come at a performance cost in 1369 terms of using TURN relays and, in the latter case, delaying ICE. 1370 Sites SHOULD make users aware of these tradeoffs. 1372 Note that the protections provided here assume a non-malicious 1373 calling service. As the calling service always knows the users 1374 status and (absent the use of a technology like Tor) their IP 1375 address, they can violate the users privacy at will. Users who wish 1376 privacy against the calling sites they are using must use separate 1377 privacy enhancing technologies such as Tor. Combined WebRTC/Tor 1378 implementations SHOULD arrange to route the media as well as the 1379 signaling through Tor. Currently this will produce very suboptimal 1380 performance. 1382 Additionally, any identifier which persists across multiple calls is 1383 potentially a problem for privacy, especially for anonymous calling 1384 services. Such services SHOULD instruct the browser to use separate 1385 DTLS keys for each call and also to use TURN throughout the call. 1386 Otherwise, the other side will learn linkable information. 1387 Additionally, browsers SHOULD implement the privacy-preserving CNAME 1388 generation mode of [I-D.ietf-avtcore-6222bis]. 1390 6.3. Denial of Service 1392 The consent mechanisms described in this document are intended to 1393 mitigate denial of service attacks in which an attacker uses clients 1394 to send large amounts of traffic to a victim without the consent of 1395 the victim. While these mechanisms are sufficient to protect victims 1396 who have not implemented WebRTC at all, WebRTC implementations need 1397 to be more careful. 1399 Consider the case of a call center which accepts calls via WebRTC. 1400 An attacker proxies the call center's front-end and arranges for 1401 multiple clients to initiate calls to the call center. Note that 1402 this requires user consent in many cases but because the data channel 1403 does not need consent, he can use that directly. Since ICE will 1404 complete, browsers can then be induced to send large amounts of data 1405 to the victim call center if it supports the data channel at all. 1406 Preventing this attack requires that automated WebRTC implementations 1407 implement sensible flow control and have the ability to triage out 1408 (i.e., stop responding to ICE probes on) calls which are behaving 1409 badly, and especially to be prepared to remotely throttle the data 1410 channel in the absence of plausible audio and video (which the 1411 attacker cannot control). 1413 Another related attack is for the signaling service to swap the ICE 1414 candidates for the audio and video streams, thus forcing a browser to 1415 send video to the sink that the other victim expects will contain 1416 audio (perhaps it is only expecting audio!) potentially causing 1417 overload. Muxing multiple media flows over a single transport makes 1418 it harder to individually suppress a single flow by denying ICE 1419 keepalives. Either media-level (RTCP) mechanisms must be used or the 1420 implementation must deny responses entirely, thus terminating the 1421 call. 1423 Yet another attack, suggested by Magnus Westerlund, is for the 1424 attacker to cross-connect offers and answers as follows. It induces 1425 the victim to make a call and then uses its control of other users 1426 browsers to get them to attempt a call to someone. It then 1427 translates their offers into apparent answers to the victim, which 1428 looks like large-scale parallel forking. The victim still responds 1429 to ICE responses and now the browsers all try to send media to the 1430 victim. Implementations can defend themselves from this attack by 1431 only responding to ICE Binding Requests for a limited number of 1432 remote ufrags (this is the reason for the requirement that the JS not 1433 be able to control the ufrag and password). 1435 [I-D.ietf-rtcweb-rtp-usage] Section 13 documents a number of 1436 potential RTCP-based DoS attacks and countermeasures. 1438 Note that attacks based on confusing one end or the other about 1439 consent are possible even in the face of the third-party identity 1440 mechanism as long as major parts of the signaling messages are not 1441 signed. On the other hand, signing the entire message severely 1442 restricts the capabilities of the calling application, so there are 1443 difficult tradeoffs here. 1445 6.4. IdP Authentication Mechanism 1447 This mechanism relies for its security on the IdP and on the 1448 PeerConnection correctly enforcing the security invariants described 1449 above. At a high level, the IdP is attesting that the user 1450 identified in the assertion wishes to be associated with the 1451 assertion. Thus, it must not be possible for arbitrary third parties 1452 to get assertions tied to a user or to produce assertions that RPs 1453 will accept. 1455 6.4.1. PeerConnection Origin Check 1457 Fundamentally, the IdP proxy is just a piece of HTML and JS loaded by 1458 the browser, so nothing stops a Web attacker from creating their own 1459 IFRAME, loading the IdP proxy HTML/JS, and requesting a signature. 1460 In order to prevent this attack, we require that all signatures be 1461 tied to a specific origin ("rtcweb://...") which cannot be produced 1462 by content JavaScript. Thus, while an attacker can instantiate the 1463 IdP proxy, they cannot send messages from an appropriate origin and 1464 so cannot create acceptable assertions. I.e., the assertion request 1465 must have come from the browser. This origin check is enforced on 1466 the relying party side, not on the authenticating party side. The 1467 reason for this is to take the burden of knowing which origins are 1468 valid off of the IdP, thus making this mechanism extensible to other 1469 applications besides WebRTC. The IdP simply needs to gather the 1470 origin information (from the posted message) and attach it to the 1471 assertion. 1473 Note that although this origin check is enforced on the RP side and 1474 not at the IdP, it is absolutely imperative that it be done. The 1475 mechanisms in this document rely on the browser enforcing access 1476 restrictions on the DTLS keys and assertion requests which do not 1477 come with the right origin may be from content JS rather than from 1478 browsers, and therefore those access restrictions cannot be assumed. 1480 Note that this check only asserts that the browser (or some other 1481 entity with access to the user's authentication data) attests to the 1482 request and hence to the fingerprint. It does not demonstrate that 1483 the browser has access to the associated private key. However, 1484 attaching one's identity to a key that the user does not control does 1485 not appear to provide substantial leverage to an attacker, so a proof 1486 of possession is omitted for simplicity. 1488 6.4.2. IdP Well-known URI 1490 As described in Section 5.6.5 the IdP proxy HTML/JS landing page is 1491 located at a well-known URI based on the IdP's domain name. This 1492 requirement prevents an attacker who can write some resources at the 1493 IdP (e.g., on one's Facebook wall) from being able to impersonate the 1494 IdP. 1496 6.4.3. Privacy of IdP-generated identities and the hosting site 1498 Depending on the structure of the IdP's assertions, the calling site 1499 may learn the user's identity from the perspective of the IdP. In 1500 many cases this is not an issue because the user is authenticating to 1501 the site via the IdP in any case, for instance when the user has 1502 logged in with Facebook Connect and is then authenticating their call 1503 with a Facebook identity. However, in other case, the user may not 1504 have already revealed their identity to the site. In general, IdPs 1505 SHOULD either verify that the user is willing to have their identity 1506 revealed to the site (e.g., through the usual IdP permissions dialog) 1507 or arrange that the identity information is only available to known 1508 RPs (e.g., social graph adjacencies) but not to the calling site. 1509 The "origin" field of the signature request can be used to check that 1510 the user has agreed to disclose their identity to the calling site; 1511 because it is supplied by the PeerConnection it can be trusted to be 1512 correct. 1514 6.4.4. Security of Third-Party IdPs 1516 As discussed above, each third-party IdP represents a new universal 1517 trust point and therefore the number of these IdPs needs to be quite 1518 limited. Most IdPs, even those which issue unqualified identities 1519 such as Facebook, can be recast as authoritative IdPs (e.g., 1520 123456@facebook.com). However, in such cases, the user interface 1521 implications are not entirely desirable. One intermediate approach 1522 is to have special (potentially user configurable) UI for large 1523 authoritative IdPs, thus allowing the user to instantly grasp that 1524 the call is being authenticated by Facebook, Google, etc. 1526 6.4.5. Web Security Feature Interactions 1528 A number of optional Web security features have the potential to 1529 cause issues for this mechanism, as discussed below. 1531 6.4.5.1. Popup Blocking 1533 The IdP proxy is unable to generate popup windows, dialogs or any 1534 other form of user interactions. This prevents the IdP proxy from 1535 being used to circumvent user interaction. The "LOGINNEEDED" message 1536 allows the IdP proxy to inform the calling site of a need for user 1537 login, providing the information necessary to satisfy this 1538 requirement without resorting to direct user interaction from the IdP 1539 proxy itself. 1541 6.4.5.2. Third Party Cookies 1543 Some browsers allow users to block third party cookies (cookies 1544 associated with origins other than the top level page) for privacy 1545 reasons. Any IdP which uses cookies to persist logins will be broken 1546 by third-party cookie blocking. One option is to accept this as a 1547 limitation; another is to have the PeerConnection object disable 1548 third-party cookie blocking for the IdP proxy. 1550 7. IANA Considerations 1552 This specification defines the "identity" SDP attribute per the 1553 procedures of Section 8.2.4 of [RFC4566]. The required information 1554 for the registration is included here: 1556 Contact Name: Eric Rescorla (ekr@rftm.com) 1558 Attribute Name: identity 1560 Long Form: identity 1562 Type of Attribute: session-level 1564 Charset Considerations: This attribute is not subject to the charset 1565 attribute. 1567 Purpose: This attribute carries an identity assertion, binding an 1568 identity to the transport-level security session. 1570 Appropriate Values: See Section 5.6.4.2 of RFCXXXX [[Editor Note: 1571 This document. 1573 8. Acknowledgements 1575 Bernard Aboba, Harald Alvestrand, Richard Barnes, Dan Druta, Cullen 1576 Jennings, Hadriel Kaplan, Matthew Kaufman, Jim McEachern, Martin 1577 Thomson, Magnus Westerland. Matthew Kaufman provided the UI material 1578 in Section 5.5. 1580 9. Changes 1582 9.1. Changes since -10 1584 Update cipher suite profiles. 1586 Rework IdP interaction based on implementation experience in Firefox. 1588 9.2. Changes since -06 1590 Replaced RTCWEB and RTC-Web with WebRTC, except when referring to the 1591 IETF WG 1593 Forbade use in mixed content as discussed in Orlando. 1595 Added a requirement to surface NULL ciphers to the top-level. 1597 Tried to clarify SRTP versus DTLS-SRTP. 1599 Added a section on screen sharing permissions. 1601 Assorted editorial work. 1603 9.3. Changes since -05 1605 The following changes have been made since the -05 draft. 1607 o Response to comments from Richard Barnes 1609 o More explanation of the IdP security properties and the federation 1610 use case. 1612 o Editorial cleanup. 1614 9.4. Changes since -03 1616 Version -04 was a version control mistake. Please ignore. 1618 The following changes have been made since the -04 draft. 1620 o Move origin check from IdP to RP per discussion in YVR. 1622 o Clarified treatment of X.509-level identities. 1624 o Editorial cleanup. 1626 9.5. Changes since -03 1628 9.6. Changes since -02 1630 The following changes have been made since the -02 draft. 1632 o Forbid persistent HTTP permissions. 1634 o Clarified the text in S 5.4 to clearly refer to requirements on 1635 the API to provide functionality to the site. 1637 o Fold in the IETF portion of draft-rescorla-rtcweb-generic-idp 1639 o Retarget the continuing consent section to assume Binding Requests 1641 o Added some more privacy and linkage text in various places. 1643 o Editorial improvements 1645 10. References 1647 10.1. Normative References 1649 [I-D.ietf-avtcore-6222bis] 1650 Begen, A., Perkins, C., Wing, D., and E. Rescorla, 1651 "Guidelines for Choosing RTP Control Protocol (RTCP) 1652 Canonical Names (CNAMEs)", draft-ietf-avtcore-6222bis-06 1653 (work in progress), July 2013. 1655 [I-D.ietf-rtcweb-rtp-usage] 1656 Perkins, C., Westerlund, M., and J. Ott, "Web Real-Time 1657 Communication (WebRTC): Media Transport and Use of RTP", 1658 draft-ietf-rtcweb-rtp-usage-22 (work in progress), 1659 February 2015. 1661 [I-D.ietf-rtcweb-security] 1662 Rescorla, E., "Security Considerations for WebRTC", draft- 1663 ietf-rtcweb-security-08 (work in progress), February 2015. 1665 [I-D.ietf-tsvwg-sctp-dtls-encaps] 1666 Tuexen, M., Stewart, R., Jesup, R., and S. Loreto, "DTLS 1667 Encapsulation of SCTP Packets", draft-ietf-tsvwg-sctp- 1668 dtls-encaps-09 (work in progress), January 2015. 1670 [I-D.muthu-behave-consent-freshness] 1671 Perumal, M., Wing, D., R, R., and T. Reddy, "STUN Usage 1672 for Consent Freshness", draft-muthu-behave-consent- 1673 freshness-04 (work in progress), July 2013. 1675 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1676 Requirement Levels", BCP 14, RFC 2119, March 1997. 1678 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1680 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1681 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1682 RFC 3711, March 2004. 1684 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1685 Security", RFC 4347, April 2006. 1687 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1688 Description Protocol", RFC 4566, July 2006. 1690 [RFC4572] Lennox, J., "Connection-Oriented Media Transport over the 1691 Transport Layer Security (TLS) Protocol in the Session 1692 Description Protocol (SDP)", RFC 4572, July 2006. 1694 [RFC4627] Crockford, D., "The application/json Media Type for 1695 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1697 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1698 Encodings", RFC 4648, October 2006. 1700 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1701 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1703 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1704 (ICE): A Protocol for Network Address Translator (NAT) 1705 Traversal for Offer/Answer Protocols", RFC 5245, April 1706 2010. 1708 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1709 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1711 [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework 1712 for Establishing a Secure Real-time Transport Protocol 1713 (SRTP) Security Context Using Datagram Transport Layer 1714 Security (DTLS)", RFC 5763, May 2010. 1716 [RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer 1717 Security (DTLS) Extension to Establish Keys for the Secure 1718 Real-time Transport Protocol (SRTP)", RFC 5764, May 2010. 1720 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 1721 Uniform Resource Identifiers (URIs)", RFC 5785, April 1722 2010. 1724 [RFC5890] Klensin, J., "Internationalized Domain Names for 1725 Applications (IDNA): Definitions and Document Framework", 1726 RFC 5890, August 2010. 1728 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, December 1729 2011. 1731 [WebMessaging] 1732 Hickson, , "HTML5 Web Messaging", May 2012, 1733 . 1735 [webcrypto] 1736 Dahl, Sleevi, , "Web Cryptography API", June 2013. 1738 Available at http://www.w3.org/TR/WebCryptoAPI/ 1740 [webrtc-api] 1741 Bergkvist, Burnett, Jennings, Narayanan, , "WebRTC 1.0: 1742 Real-time Communication Between Browsers", October 2011. 1744 Available at http://dev.w3.org/2011/webrtc/editor/ 1745 webrtc.html 1747 10.2. Informative References 1749 [I-D.ietf-rtcweb-jsep] 1750 Uberti, J., Jennings, C., and E. Rescorla, "Javascript 1751 Session Establishment Protocol", draft-ietf-rtcweb-jsep-08 1752 (work in progress), October 2014. 1754 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 1755 Leach, P., Luotonen, A., and L. Stewart, "HTTP 1756 Authentication: Basic and Digest Access Authentication", 1757 RFC 2617, June 1999. 1759 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1760 A., Peterson, J., Sparks, R., Handley, M., and E. 1761 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1762 June 2002. 1764 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1765 Layer Security (TLS)", RFC 5705, March 2010. 1767 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 1768 April 2011. 1770 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 1771 6455, December 2011. 1773 [XmlHttpRequest] 1774 van Kesteren, A., "XMLHttpRequest Level 2", January 2012. 1776 Appendix A. Example IdP Bindings to Specific Protocols 1778 [[TODO: These still need some cleanup.]] 1780 This section provides some examples of how the mechanisms described 1781 in this document could be used with existing authentication protocols 1782 such as BrowserID or OAuth. Note that this does not require browser- 1783 level support for either protocol. Rather, the protocols can be fit 1784 into the generic framework. (Though BrowserID in particular works 1785 better with some client side support). 1787 A.1. BrowserID 1789 BrowserID [https://browserid.org/] is a technology which allows a 1790 user with a verified email address to generate an assertion 1791 (authenticated by their identity provider) attesting to their 1792 identity (phrased as an email address). The way that this is used in 1793 practice is that the relying party embeds JS in their site which 1794 talks to the BrowserID code (either hosted on a trusted intermediary 1795 or embedded in the browser). That code generates the assertion which 1796 is passed back to the relying party for verification. The assertion 1797 can be verified directly or with a Web service provided by the 1798 identity provider. It's relatively easy to extend this functionality 1799 to authenticate WebRTC calls, as shown below. 1801 +----------------------+ +----------------------+ 1802 | | | | 1803 | Alice's Browser | | Bob's Browser | 1804 | | OFFER ------------> | | 1805 | Calling JS Code | | Calling JS Code | 1806 | ^ | | ^ | 1807 | | | | | | 1808 | v | | v | 1809 | PeerConnection | | PeerConnection | 1810 | | ^ | | | ^ | 1811 | Finger| |Signed | |Signed | | | 1812 | print | |Finger | |Finger | |"Alice"| 1813 | | |print | |print | | | 1814 | v | | | v | | 1815 | +--------------+ | | +---------------+ | 1816 | | IdP Proxy | | | | IdP Proxy | | 1817 | | to | | | | to | | 1818 | | BrowserID | | | | BrowserID | | 1819 | | Signer | | | | Verifier | | 1820 | +--------------+ | | +---------------+ | 1821 | ^ | | ^ | 1822 +-----------|----------+ +----------|-----------+ 1823 | | 1824 | Get certificate | 1825 v | Check 1826 +----------------------+ | certificate 1827 | | | 1828 | Identity |/-------------------------------+ 1829 | Provider | 1830 | | 1831 +----------------------+ 1833 The way this mechanism works is as follows. On Alice's side, Alice 1834 goes to initiate a call. 1836 1. The calling JS instantiates a PeerConnection and tells it that it 1837 is interested in having it authenticated via BrowserID (i.e., it 1838 provides "browserid.org" as the IdP name.) 1840 2. The PeerConnection instantiates the BrowserID signer in the IdP 1841 proxy 1843 3. The BrowserID signer contacts Alice's identity provider, 1844 authenticating as Alice (likely via a cookie). 1846 4. The identity provider returns a short-term certificate attesting 1847 to Alice's identity and her short-term public key. 1849 5. The Browser-ID code signs the fingerprint and returns the signed 1850 assertion + certificate to the PeerConnection. 1852 6. The PeerConnection returns the signed information to the calling 1853 JS code. 1855 7. The signed assertion gets sent over the wire to Bob's browser 1856 (via the signaling service) as part of the call setup. 1858 The offer might look something like: 1860 { 1861 "type":"OFFER", 1862 "sdp": 1863 "v=0\n 1864 o=- 2890844526 2890842807 IN IP4 192.0.2.1\n 1865 s= \n 1866 c=IN IP4 192.0.2.1\n 1867 t=2873397496 2873404696\n 1868 a=fingerprint:SHA-1 ...\n 1869 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\n 1870 a=identity [[base-64 encoding of identity assertion: 1871 { 1872 "idp":{ // Standardized 1873 "domain":"browserid.org", 1874 "method":"default" 1875 }, 1876 // Assertion contents are browserid-specific 1877 "assertion": "{ 1878 \"assertion\": { 1879 \"digest\":\"\", 1880 \"audience\": \"\" 1881 \"valid-until\": 1308859352261, 1882 }, 1883 \"certificate\": { 1884 \"email\": \"rescorla@example.org\", 1885 \"public-key\": \"\", 1886 \"valid-until\": 1308860561861, 1887 \"signature\": \"\" 1888 }, 1889 \"content\": \"\" 1890 }" 1891 } 1892 ]]\n 1893 m=audio 49170 RTP/AVP 0\n 1894 ..." 1895 } 1897 Note that while the IdP here is specified as "browserid.org", the 1898 actual certificate is signed by example.org. This is because 1899 BrowserID is a combined authoritative/third-party system in which 1900 browserid.org delegates the right to be authoritative (what BrowserID 1901 calls primary) to individual domains. 1903 On Bob's side, he receives the signed assertion as part of the call 1904 setup message and a similar procedure happens to verify it. 1906 1. The calling JS instantiates a PeerConnection and provides it the 1907 relevant signaling information, including the signed assertion. 1909 2. The PeerConnection instantiates the IdP proxy which examines the 1910 IdP name and brings up the BrowserID verification code. 1912 3. The BrowserID verifier contacts the identity provider to verify 1913 the certificate and then uses the key to verify the signed 1914 fingerprint. 1916 4. Alice's verified identity is returned to the PeerConnection (it 1917 already has the fingerprint). 1919 5. At this point, Bob's browser can display a trusted UI indication 1920 that Alice is on the other end of the call. 1922 When Bob returns his answer, he follows the converse procedure, which 1923 provides Alice with a signed assertion of Bob's identity and keying 1924 material. 1926 A.2. OAuth 1928 While OAuth is not directly designed for user-to-user authentication, 1929 with a little lateral thinking it can be made to serve. We use the 1930 following mapping of OAuth concepts to WebRTC concepts: 1932 +----------------------+----------------------+ 1933 | OAuth | WebRTC | 1934 +----------------------+----------------------+ 1935 | Client | Relying party | 1936 | Resource owner | Authenticating party | 1937 | Authorization server | Identity service | 1938 | Resource server | Identity service | 1939 +----------------------+----------------------+ 1941 Table 1 1943 The idea here is that when Alice wants to authenticate to Bob (i.e., 1944 for Bob to be aware that she is calling). In order to do this, she 1945 allows Bob to see a resource on the identity provider that is bound 1946 to the call, her identity, and her public key. Then Bob retrieves 1947 the resource from the identity provider, thus verifying the binding 1948 between Alice and the call. 1950 Alice IdP Bob 1951 --------------------------------------------------------- 1952 Call-Id, Fingerprint -------> 1953 <------------------- Auth Code 1954 Auth Code ----------------------------------------------> 1955 <----- Get Token + Auth Code 1956 Token ---------------------> 1957 <------------- Get call-info 1958 Call-Id, Fingerprint ------> 1960 This is a modified version of a common OAuth flow, but omits the 1961 redirects required to have the client point the resource owner to the 1962 IdP, which is acting as both the resource server and the 1963 authorization server, since Alice already has a handle to the IdP. 1965 Above, we have referred to "Alice", but really what we mean is the 1966 PeerConnection. Specifically, the PeerConnection will instantiate an 1967 IFRAME with JS from the IdP and will use that IFRAME to communicate 1968 with the IdP, authenticating with Alice's identity (e.g., cookie). 1969 Similarly, Bob's PeerConnection instantiates an IFRAME to talk to the 1970 IdP. 1972 Author's Address 1974 Eric Rescorla 1975 RTFM, Inc. 1976 2064 Edgewood Drive 1977 Palo Alto, CA 94303 1978 USA 1980 Phone: +1 650 678 2350 1981 Email: ekr@rtfm.com