idnits 2.17.1 draft-ietf-rtcweb-security-arch-06.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 seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The abstract seems to contain references ([I-D.ietf-rtcweb-security]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. -- 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 == 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 (January 22, 2013) is 4084 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: 'I-D.jennings-rtcweb-signaling' is defined on line 1622, but no explicit reference was found in the text == Outdated reference: A later version (-12) exists of draft-ietf-rtcweb-security-03 == Outdated reference: A later version (-04) exists of draft-muthu-behave-consent-freshness-02 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5245 (Obsoleted by RFC 8445, RFC 8839) == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-jsep-02 Summary: 6 errors (**), 0 flaws (~~), 6 warnings (==), 2 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 January 22, 2013 5 Expires: July 26, 2013 7 RTCWEB Security Architecture 8 draft-ietf-rtcweb-security-arch-06 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 (e.g 15 JavaScript). The major use cases for RTCWEB technology are real-time 16 audio and/or video calls, Web conferencing, and direct data transfer. 17 Unlike most conventional real-time systems (e.g., SIP-based soft 18 phones) RTCWEB communications are directly controlled by some Web 19 server, which poses new security challenges. For instance, a Web 20 browser might expose a JavaScript API which allows a server to place 21 a video call. Unrestricted access to such an API would allow any 22 site which a user visited to "bug" a user's computer, capturing any 23 activity which passed in front of their camera. [I-D.ietf-rtcweb- 24 security] defines the RTCWEB threat model. This document defines an 25 architecture which provides security within that threat model. 27 Legal 29 THIS DOCUMENT AND THE INFORMATION CONTAINED THEREIN ARE PROVIDED ON 30 AN "AS IS" BASIS AND THE CONTRIBUTOR, THE ORGANIZATION HE/SHE 31 REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE 32 IETF TRUST, AND THE INTERNET ENGINEERING TASK FORCE, DISCLAIM ALL 33 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY 34 WARRANTY THAT THE USE OF THE INFORMATION THEREIN WILL NOT INFRINGE 35 ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS 36 FOR A PARTICULAR PURPOSE. 38 Status of this Memo 40 This Internet-Draft is submitted in full conformance with the 41 provisions of BCP 78 and BCP 79. 43 Internet-Drafts are working documents of the Internet Engineering 44 Task Force (IETF). Note that other groups may also distribute 45 working documents as Internet-Drafts. The list of current Internet- 46 Drafts is at http://datatracker.ietf.org/drafts/current/. 48 Internet-Drafts are draft documents valid for a maximum of six months 49 and may be updated, replaced, or obsoleted by other documents at any 50 time. It is inappropriate to use Internet-Drafts as reference 51 material or to cite them other than as "work in progress." 53 This Internet-Draft will expire on July 26, 2013. 55 Copyright Notice 57 Copyright (c) 2013 IETF Trust and the persons identified as the 58 document authors. All rights reserved. 60 This document is subject to BCP 78 and the IETF Trust's Legal 61 Provisions Relating to IETF Documents 62 (http://trustee.ietf.org/license-info) in effect on the date of 63 publication of this document. Please review these documents 64 carefully, as they describe your rights and restrictions with respect 65 to this document. Code Components extracted from this document must 66 include Simplified BSD License text as described in Section 4.e of 67 the Trust Legal Provisions and are provided without warranty as 68 described in the Simplified BSD License. 70 This document may contain material from IETF Documents or IETF 71 Contributions published or made publicly available before November 72 10, 2008. The person(s) controlling the copyright in some of this 73 material may not have granted the IETF Trust the right to allow 74 modifications of such material outside the IETF Standards Process. 75 Without obtaining an adequate license from the person(s) controlling 76 the copyright in such materials, this document may not be modified 77 outside the IETF Standards Process, and derivative works of it may 78 not be created outside the IETF Standards Process, except to format 79 it for publication as an RFC or to translate it into languages other 80 than English. 82 Table of Contents 84 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 85 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 86 3. Trust Model . . . . . . . . . . . . . . . . . . . . . . . . . 6 87 3.1. Authenticated Entities . . . . . . . . . . . . . . . . . . 7 88 3.2. Unauthenticated Entities . . . . . . . . . . . . . . . . . 7 89 4. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 90 4.1. Initial Signaling . . . . . . . . . . . . . . . . . . . . 10 91 4.2. Media Consent Verification . . . . . . . . . . . . . . . . 12 92 4.3. DTLS Handshake . . . . . . . . . . . . . . . . . . . . . . 13 93 4.4. Communications and Consent Freshness . . . . . . . . . . . 13 94 5. Detailed Technical Description . . . . . . . . . . . . . . . . 14 95 5.1. Origin and Web Security Issues . . . . . . . . . . . . . . 14 96 5.2. Device Permissions Model . . . . . . . . . . . . . . . . . 14 97 5.3. Communications Consent . . . . . . . . . . . . . . . . . . 16 98 5.4. IP Location Privacy . . . . . . . . . . . . . . . . . . . 17 99 5.5. Communications Security . . . . . . . . . . . . . . . . . 18 100 5.6. Web-Based Peer Authentication . . . . . . . . . . . . . . 19 101 5.6.1. Trust Relationships: IdPs, APs, and RPs . . . . . . . 20 102 5.6.2. Overview of Operation . . . . . . . . . . . . . . . . 21 103 5.6.3. Items for Standardization . . . . . . . . . . . . . . 23 104 5.6.4. Binding Identity Assertions to JSEP Offer/Answer 105 Transactions . . . . . . . . . . . . . . . . . . . . . 23 106 5.6.4.1. Input to Assertion Generation Process . . . . . . 23 107 5.6.4.2. Carrying Identity Assertions . . . . . . . . . . . 24 108 5.6.5. IdP Interaction Details . . . . . . . . . . . . . . . 24 109 5.6.5.1. General Message Structure . . . . . . . . . . . . 24 110 5.6.5.2. IdP Proxy Setup . . . . . . . . . . . . . . . . . 25 111 5.7. Security Considerations . . . . . . . . . . . . . . . . . 30 112 5.7.1. Communications Security . . . . . . . . . . . . . . . 30 113 5.7.2. Privacy . . . . . . . . . . . . . . . . . . . . . . . 31 114 5.7.3. Denial of Service . . . . . . . . . . . . . . . . . . 32 115 5.7.4. IdP Authentication Mechanism . . . . . . . . . . . . . 33 116 5.7.4.1. PeerConnection Origin Check . . . . . . . . . . . 33 117 5.7.4.2. IdP Well-known URI . . . . . . . . . . . . . . . . 34 118 5.7.4.3. Privacy of IdP-generated identities and the 119 hosting site . . . . . . . . . . . . . . . . . . . 34 120 5.7.4.4. Security of Third-Party IdPs . . . . . . . . . . . 34 121 5.7.4.5. Web Security Feature Interactions . . . . . . . . 35 122 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 35 123 7. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 124 7.1. Changes since -05 . . . . . . . . . . . . . . . . . . . . 36 125 7.2. Changes since -03 . . . . . . . . . . . . . . . . . . . . 36 126 7.3. Changes since -03 . . . . . . . . . . . . . . . . . . . . 36 127 7.4. Changes since -02 . . . . . . . . . . . . . . . . . . . . 36 128 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 36 129 8.1. Normative References . . . . . . . . . . . . . . . . . . . 36 130 8.2. Informative References . . . . . . . . . . . . . . . . . . 37 131 Appendix A. Example IdP Bindings to Specific Protocols . . . . . 38 132 A.1. BrowserID . . . . . . . . . . . . . . . . . . . . . . . . 38 133 A.2. OAuth . . . . . . . . . . . . . . . . . . . . . . . . . . 41 134 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 42 136 1. Introduction 138 The Real-Time Communications on the Web (RTCWEB) working group is 139 tasked with standardizing protocols for real-time communications 140 between Web browsers. The major use cases for RTCWEB technology are 141 real-time audio and/or video calls, Web conferencing, and direct data 142 transfer. Unlike most conventional real-time systems, (e.g., SIP- 143 based[RFC3261] soft phones) RTCWEB communications are directly 144 controlled by some Web server, as shown in Figure 1. 146 +----------------+ 147 | | 148 | Web Server | 149 | | 150 +----------------+ 151 ^ ^ 152 / \ 153 HTTP / \ HTTP 154 / \ 155 / \ 156 v v 157 JS API JS API 158 +-----------+ +-----------+ 159 | | Media | | 160 | Browser |<---------->| Browser | 161 | | | | 162 +-----------+ +-----------+ 164 Figure 1: A simple RTCWEB system 166 A more complicated system might allow for interdomain calling, as 167 shown in Figure 2. The protocol to be used between the domains is 168 not standardized by RTCWEB, but given the installed base and the form 169 of the RTCWEB API is likely to be something SDP-based like SIP or 170 XMPP. 172 +--------------+ +--------------+ 173 | | SIP,XMPP,...| | 174 | Web Server |<----------->| Web Server | 175 | | | | 176 +--------------+ +--------------+ 177 ^ ^ 178 | | 179 HTTP | | HTTP 180 | | 181 v v 182 JS API JS API 183 +-----------+ +-----------+ 184 | | Media | | 185 | Browser |<---------------->| Browser | 186 | | | | 187 +-----------+ +-----------+ 189 Figure 2: A multidomain RTCWEB system 191 This system presents a number of new security challenges, which are 192 analyzed in [I-D.ietf-rtcweb-security]. This document describes a 193 security architecture for RTCWEB which addresses the threats and 194 requirements described in that document. 196 2. Terminology 198 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 199 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 200 document are to be interpreted as described in RFC 2119 [RFC2119]. 202 3. Trust Model 204 The basic assumption of this architecture is that network resources 205 exist in a hierarchy of trust, rooted in the browser, which serves as 206 the user's TRUSTED COMPUTING BASE (TCB). Any security property which 207 the user wishes to have enforced must be ultimately guaranteed by the 208 browser (or transitively by some property the browser verifies). 209 Conversely, if the browser is compromised, then no security 210 guarantees are possible. Note that there are cases (e.g., Internet 211 kiosks) where the user can't really trust the browser that much. In 212 these cases, the level of security provided is limited by how much 213 they trust the browser. 215 Optimally, we would not rely on trust in any entities other than the 216 browser. However, this is unfortunately not possible if we wish to 217 have a functional system. Other network elements fall into two 218 categories: those which can be authenticated by the browser and thus 219 are partly trusted--though to the minimum extent necessary--and those 220 which cannot be authenticated and thus are untrusted. This is a 221 natural extension of the end-to-end principle. 223 3.1. Authenticated Entities 225 There are two major classes of authenticated entities in the system: 227 o Calling services: Web sites whose origin we can verify (optimally 228 via HTTPS, but in some cases because we are on a topologically 229 restricted network, such as behind a firewall). 230 o Other users: RTCWEB peers whose origin we can verify 231 cryptographically (optimally via DTLS-SRTP). 233 Note that merely being authenticated does not make these entities 234 trusted. For instance, just because we can verify that 235 https://www.evil.org/ is owned by Dr. Evil does not mean that we can 236 trust Dr. Evil to access our camera and microphone. However, it 237 gives the user an opportunity to determine whether he wishes to trust 238 Dr. Evil or not; after all, if he desires to contact Dr. Evil 239 (perhaps to arrange for ransom payment), it's safe to temporarily 240 give him access to the camera and microphone for the purpose of the 241 call, but he doesn't want Dr. Evil to be able to access his camera 242 and microphone other than during the call. The point here is that we 243 must first identify other elements before we can determine whether 244 and how much to trust them. 246 It's also worth noting that there are settings where authentication 247 is non-cryptographic, such as other machines behind a firewall. 248 Naturally, the level of trust one can have in identities verified in 249 this way depends on how strong the topology enforcement is. 251 3.2. Unauthenticated Entities 253 Other than the above entities, we are not generally able to identify 254 other network elements, thus we cannot trust them. This does not 255 mean that it is not possible to have any interaction with them, but 256 it means that we must assume that they will behave maliciously and 257 design a system which is secure even if they do so. 259 4. Overview 261 This section describes a typical RTCWeb session and shows how the 262 various security elements interact and what guarantees are provided 263 to the user. The example in this section is a "best case" scenario 264 in which we provide the maximal amount of user authentication and 265 media privacy with the minimal level of trust in the calling service. 266 Simpler versions with lower levels of security are also possible and 267 are noted in the text where applicable. It's also important to 268 recognize the tension between security (or performance) and privacy. 269 The example shown here is aimed towards settings where we are more 270 concerned about secure calling than about privacy, but as we shall 271 see, there are settings where one might wish to make different 272 tradeoffs--this architecture is still compatible with those settings. 274 For the purposes of this example, we assume the topology shown in the 275 figures below. This topology is derived from the topology shown in 276 Figure 1, but separates Alice and Bob's identities from the process 277 of signaling. Specifically, Alice and Bob have relationships with 278 some Identity Provider (IdP) that supports a protocol such as OpenID 279 or BrowserID) that can be used to demonstrate their identity to other 280 parties. For instance, Alice might have an account with a social 281 network which she can then use to authenticate to other web sites 282 without explicitly having an account with those sites; this is a 283 fairly conventional pattern on the Web. Section 5.6.1 provides an 284 overview of Identity Providers and the relevant terminology. 286 This separation of identity provision and signaling isn't 287 particularly important in "closed world" cases where Alice and Bob 288 are users on the same social network and have identities based on 289 that domain (Figure 3) However, there are important settings where 290 that is not the case, such as federation (calls from one domain to 291 another; Figure 4) and calling on untrusted sites, such as where two 292 users who have a relationship via a given social network want to call 293 each other on another, untrusted, site, such as a poker site. 295 Note that the servers themselves are also authenticated by an 296 external identity service, the SSL/TLS certificate infrastructure 297 (not shown). As is conventional in the Web, all identities are 298 ultimately rooted that system. For instance, when an IdP makes an 299 identity assertion, the Relying Party consuming that assertion is 300 able to verify because it is able to connect to the IdP via HTTPS. 302 +----------------+ 303 | | 304 | Signaling | 305 | Server | 306 | | 307 +----------------+ 308 ^ ^ 309 / \ 310 HTTPS / \ HTTPS 311 / \ 312 / \ 313 v v 314 JS API JS API 315 +-----------+ +-----------+ 316 | | Media | | 317 Alice | Browser |<---------->| Browser | Bob 318 | | (DTLS-SRTP)| | 319 +-----------+ +-----------+ 320 ^ ^--+ +--^ ^ 321 | | | | 322 v | | v 323 +-----------+ | | +-----------+ 324 | |<--------+ | | 325 | IdP | | | IdP | 326 | | +------->| | 327 +-----------+ +-----------+ 329 Figure 3: A call with IdP-based identity 331 Figure 4 shows essentially the same calling scenario but with a call 332 between two separate domains (i.e., a federated case). As mentioned 333 above, the domains communicate by some unspecified protocol and 334 providing separate signaling and identity allows for calls to be 335 authenticated regardless of the details of the inter-domain protocol. 337 +----------------+ Unspecified +----------------+ 338 | | protocol | | 339 | Signaling |<----------------->| Signaling | 340 | Server | (SIP, XMPP, ...) | Server | 341 | | | | 342 +----------------+ +----------------+ 343 ^ ^ 344 | | 345 HTTPS | | HTTPS 346 | | 347 | | 348 v v 349 JS API JS API 350 +-----------+ +-----------+ 351 | | Media | | 352 Alice | Browser |<--------------------------->| Browser | Bob 353 | | DTLS-SRTP | | 354 +-----------+ +-----------+ 355 ^ ^--+ +--^ ^ 356 | | | | 357 v | | v 358 +-----------+ | | +-----------+ 359 | |<-------------------------+ | | 360 | IdP | | | IdP | 361 | | +------------------------>| | 362 +-----------+ +-----------+ 364 Figure 4: A federated call with IdP-based identity 366 4.1. Initial Signaling 368 For simplicity, assume the topology in Figure 3. Alice and Bob are 369 both users of a common calling service; they both have approved the 370 calling service to make calls (we defer the discussion of device 371 access permissions till later). They are both connected to the 372 calling service via HTTPS and so know the origin with some level of 373 confidence. They also have accounts with some identity provider. 374 This sort of identity service is becoming increasingly common in the 375 Web environment in technologies such (BrowserID, Federated Google 376 Login, Facebook Connect, OAuth, OpenID, WebFinger), and is often 377 provided as a side effect service of a user's ordinary accounts with 378 some service. In this example, we show Alice and Bob using a 379 separate identity service, though the identity service may be the 380 same entity as the calling service or there may be no identity 381 service at all. 383 Alice is logged onto the calling service and decides to call Bob. She 384 can see from the calling service that he is online and the calling 385 service presents a JS UI in the form of a button next to Bob's name 386 which says "Call". Alice clicks the button, which initiates a JS 387 callback that instantiates a PeerConnection object. This does not 388 require a security check: JS from any origin is allowed to get this 389 far. 391 Once the PeerConnection is created, the calling service JS needs to 392 set up some media. Because this is an audio/video call, it creates 393 two MediaStreams, one connected to an audio input and one connected 394 to a video input. At this point the first security check is 395 required: untrusted origins are not allowed to access the camera and 396 microphone. In this case, because Alice is a long-term user of the 397 calling service, she has made a permissions grant (i.e., a setting in 398 the browser) to allow the calling service to access her camera and 399 microphone any time it wants. The browser checks this setting when 400 the camera and microphone requests are made and thus allows them. 402 In the current W3C API, once some streams have been added, Alice's 403 browser + JS generates a signaling message [I-D.ietf-rtcweb-jsep] 404 containing: 406 o Media channel information 407 o ICE candidates 408 o A fingerprint attribute binding the communication to a key pair 409 [RFC5763]. Note that this key may simply be ephemerally generated 410 for this call or specific to this domain, and Alice may have a 411 large number of such keys. 413 Prior to sending out the signaling message, the PeerConnection code 414 contacts the identity service and obtains an assertion binding 415 Alice's identity to her fingerprint. The exact details depend on the 416 identity service (though as discussed in Section 5.6 PeerConnection 417 can be agnostic to them), but for now it's easiest to think of as a 418 BrowserID assertion. The assertion may bind other information to the 419 identity besides the fingerprint, but at minimum it needs to bind the 420 fingerprint. 422 This message is sent to the signaling server, e.g., by XMLHttpRequest 423 [XmlHttpRequest] or by WebSockets [RFC6455] The signaling server 424 processes the message from Alice's browser, determines that this is a 425 call to Bob and sends a signaling message to Bob's browser (again, 426 the format is currently undefined). The JS on Bob's browser 427 processes it, and alerts Bob to the incoming call and to Alice's 428 identity. In this case, Alice has provided an identity assertion and 429 so Bob's browser contacts Alice's identity provider (again, this is 430 done in a generic way so the browser has no specific knowledge of the 431 IdP) to verify the assertion. This allows the browser to display a 432 trusted element in the browser chrome indicating that a call is 433 coming in from Alice. If Alice is in Bob's address book, then this 434 interface might also include her real name, a picture, etc. The 435 calling site will also provide some user interface element (e.g., a 436 button) to allow Bob to answer the call, though this is most likely 437 not part of the trusted UI. 439 If Bob agrees [I am ignoring early media for now], a PeerConnection 440 is instantiated with the message from Alice's side. Then, a similar 441 process occurs as on Alice's browser: Bob's browser verifies that 442 the calling service is approved, the media streams are created, and a 443 return signaling message containing media information, ICE 444 candidates, and a fingerprint is sent back to Alice via the signaling 445 service. If Bob has a relationship with an IdP, the message will 446 also come with an identity assertion. 448 At this point, Alice and Bob each know that the other party wants to 449 have a secure call with them. Based purely on the interface provided 450 by the signaling server, they know that the signaling server claims 451 that the call is from Alice to Bob. This level of security is 452 provided merely by having the fingerprint in the message and having 453 that message received securely from the signaling server. Because 454 the far end sent an identity assertion along with their message, they 455 know that this is verifiable from the IdP as well. Note that if the 456 call is federated, as shown in Figure 4 then Alice is able to verify 457 Bob's identity in a way that is not mediated by either her signaling 458 server or Bob's. Rather, she verifies it directly with Bob's IdP. 460 Of course, the call works perfectly well if either Alice or Bob 461 doesn't have a relationship with an IdP; they just get a lower level 462 of assurance. I.e., they simply have whatever information their 463 calling site claims about the caller/calllee's identity. Moreover, 464 Alice might wish to make an anonymous call through an anonymous 465 calling site, in which case she would of course just not provide any 466 identity assertion and the calling site would mask her identity from 467 Bob. 469 4.2. Media Consent Verification 471 As described in ([I-D.ietf-rtcweb-security]; Section 4.2) media 472 consent verification is provided via ICE. Thus, Alice and Bob 473 perform ICE checks with each other. At the completion of these 474 checks, they are ready to send non-ICE data. 476 At this point, Alice knows that (a) Bob (assuming he is verified via 477 his IdP) or someone else who the signaling service is claiming is Bob 478 is willing to exchange traffic with her and (b) that either Bob is at 479 the IP address which she has verified via ICE or there is an attacker 480 who is on-path to that IP address detouring the traffic. Note that 481 it is not possible for an attacker who is on-path between Alice and 482 Bob but not attached to the signaling service to spoof these checks 483 because they do not have the ICE credentials. Bob's has the same 484 security guarantees with respect to Alice. 486 4.3. DTLS Handshake 488 Once the ICE checks have completed [more specifically, once some ICE 489 checks have completed], Alice and Bob can set up a secure channel. 490 This is performed via DTLS [RFC4347] (for the data channel) and DTLS- 491 SRTP [RFC5763] for the media channel. Specifically, Alice and Bob 492 perform a DTLS handshake on every channel which has been established 493 by ICE. The total number of channels depends on the amount of 494 muxing; in the most likely case we are using both RTP/RTCP mux and 495 muxing multiple media streams on the same channel, in which case 496 there is only one DTLS handshake. Once the DTLS handshake has 497 completed, the keys are exported [RFC5705] and used to key SRTP for 498 the media channels. 500 At this point, Alice and Bob know that they share a set of secure 501 data and/or media channels with keys which are not known to any 502 third-party attacker. If Alice and Bob authenticated via their IdPs, 503 then they also know that the signaling service is not mounting a man- 504 in-the-middle attack on theor traffic. Even if they do not use an 505 IdP, as long as they have minimal trust in the signaling service not 506 to perform a man-in-the-middle attack, they know that their 507 communications are secure against the signaling service as well 508 (i.e., that the signaling service cannot mount a passive attack on 509 the communications). 511 4.4. Communications and Consent Freshness 513 From a security perspective, everything from here on in is a little 514 anticlimactic: Alice and Bob exchange data protected by the keys 515 negotiated by DTLS. Because of the security guarantees discussed in 516 the previous sections, they know that the communications are 517 encrypted and authenticated. 519 The one remaining security property we need to establish is "consent 520 freshness", i.e., allowing Alice to verify that Bob is still prepared 521 to receive her communications so that Alice does not continue to send 522 large traffic volumes to entities which went abruptly offline. ICE 523 specifies periodic STUN keepalizes but only if media is not flowing. 524 Because the consent issue is more difficult here, we require RTCWeb 525 implementations to periodically send keepalives. As described in 526 Section 5.3, these keepalives MUST be based on the consent freshness 527 mechanism specified in [I-D.muthu-behave-consent-freshness]. If a 528 keepalive fails and no new ICE channels can be established, then the 529 session is terminated. 531 5. Detailed Technical Description 533 5.1. Origin and Web Security Issues 535 The basic unit of permissions for RTCWEB is the origin [RFC6454]. 536 Because the security of the origin depends on being able to 537 authenticate content from that origin, the origin can only be 538 securely established if data is transferred over HTTPS [RFC2818]. 539 Thus, clients MUST treat HTTP and HTTPS origins as different 540 permissions domains. [Note: this follows directly from the origin 541 security model and is stated here merely for clarity.] 543 Many web browsers currently forbid by default any active mixed 544 content on HTTPS pages. That is, when JavaScript is loaded from an 545 HTTP origin onto an HTTPS page, an error is displayed and the HTTP 546 content is not executed unless the user overrides the error. Any 547 browser which enforces such a policy will also not permit access to 548 RTCWEB functionality from mixed content pages (because they never 549 display mixed content). It is RECOMMENDED that browsers which allow 550 active mixed content nevertheless disable RTCWEB functionality in 551 mixed content settings. [[ OPEN ISSUE: Should this be a 2119 MUST? 552 It's not clear what set of conditions would make this OK, other than 553 that browser manufacturers have traditionally been permissive here 554 here.]] Note that it is possible for a page which was not mixed 555 content to become mixed content during the duration of the call. 556 Implementations MAY choose to terminate the call or display a warning 557 at that point, but it is also permissible to ignore this condition. 558 The major risk here is that the newly arrived insecure JS might 559 redirect media to a location controlled by the attacker. This is a 560 deliberate implementation complexity versus security tradeoff. [[ 561 OPEN ISSUE:: Should we be more aggressive about this?]] 563 5.2. Device Permissions Model 565 Implementations MUST obtain explicit user consent prior to providing 566 access to the camera and/or microphone. Implementations MUST at 567 minimum support the following two permissions models for HTTPS 568 origins. 570 o Requests for one-time camera/microphone access. 571 o Requests for permanent access. 573 Because HTTP origins cannot be securely established against network 574 attackers, implementations MUST NOT allow the setting of permanent 575 access permissions for HTTP origins. Implementations MAY also opt to 576 refuse all permissions grants for HTTP origins, but it is RECOMMENDED 577 that currently they support one-time camera/microphone access. 579 In addition, they SHOULD support requests for access that promise 580 that media from this grant will be sent to a single communicating 581 peer (obviously there could be other requests for other peers). 582 E.g., "Call customerservice@ford.com". The semantics of this request 583 are that the media stream from the camera and microphone will only be 584 routed through a connection which has been cryptographically verified 585 (through the IdP mechanism or an X.509 certificate in the DTLS-SRTP 586 handshake) as being associated with the stated identity. Browsers 587 servicing such requests SHOULD clearly indicate that identity to the 588 user when asking for permission. The idea behind this type of 589 permissions is that a user might have a fairly narrow list of peers 590 he is willing to communicate with, e.g., "my mother" rather than 591 "anyone on Facebook". Narrow permissions grants allow the browser to 592 do that enforcement. 594 API Requirement: The API MUST provide a mechanism for the requesting 595 JS to indicate which of these forms of permissions it is 596 requesting. This allows the browser client to know what sort of 597 user interface experience to provide to the user, including what 598 permissions to request from the user and hence what to enforce 599 later. For instance, browsers might display a non-invasive door 600 hanger ("some features of this site may not work..." when asking 601 for long-term permissions) but a more invasive UI ("here is your 602 own video") for single-call permissions. The API MAY grant weaker 603 permissions than the JS asked for if the user chooses to authorize 604 only those permissions, but if it intends to grant stronger ones 605 it SHOULD display the appropriate UI for those permissions and 606 MUST clearly indicate what permissions are being requested. 608 API Requirement: The API MUST provide a mechanism for the requesting 609 JS to relinquish the ability to see or modify the media (e.g., via 610 MediaStream.record()). Combined with secure authentication of the 611 communicating peer, this allows a user to be sure that the calling 612 site is not accessing or modifying their conversion. 614 UI Requirement: The UI MUST clearly indicate when the user's camera 615 and microphone are in use. This indication MUST NOT be 616 suppressable by the JS and MUST clearly indicate how to terminate 617 device access, and provide a UI means to immediately stop camera/ 618 microphone input without the JS being able to prevent it. 620 UI Requirement: If the UI indication of camera/microphone use are 621 displayed in the browser such that minimizing the browser window 622 would hide the indication, or the JS creating an overlapping 623 window would hide the indication, then the browser SHOULD stop 624 camera and microphone input when the indication is hidden. [Note: 625 this may not be necessary in systems that are non-windows-based 626 but that have good notifications support, such as phones.] 628 Clients MAY permit the formation of data channels without any direct 629 user approval. Because sites can always tunnel data through the 630 server, further restrictions on the data channel do not provide any 631 additional security. (though see Section 5.3 for a related issue). 633 Implementations which support some form of direct user authentication 634 SHOULD also provide a policy by which a user can authorize calls only 635 to specific counterparties. Specifically, the implementation SHOULD 636 provide the following interfaces/controls: 638 o Allow future calls to this verified user. 639 o Allow future calls to any verified user who is in my system 640 address book (this only works with address book integration, of 641 course). 643 Implementations SHOULD also provide a different user interface 644 indication when calls are in progress to users whose identities are 645 directly verifiable. Section 5.5 provides more on this. 647 5.3. Communications Consent 649 Browser client implementations of RTCWEB MUST implement ICE. Server 650 gateway implementations which operate only at public IP addresses 651 MUST implement either full ICE or ICE-Lite. 653 Browser implementations MUST verify reachability via ICE prior to 654 sending any non-ICE packets to a given destination. Implementations 655 MUST NOT provide the ICE transaction ID to JavaScript during the 656 lifetime of the transaction (i.e., during the period when the ICE 657 stack would accept a new response for that transaction). [Note: 658 this document takes no position on the split between ICE in JS and 659 ICE in the browser. The above text is written the way it is for 660 editorial convenience and will be modified appropriately if the WG 661 decides on ICE in the JS.] The JS MUST NOT be permitted to control 662 the local ufrag and password, though it of course knows it. 664 While continuing consent is required, that ICE [RFC5245]; Section 10 665 keepalives STUN Binding Indications are one-way and therefore not 666 sufficient. The current WG consensus is to use ICE Binding Requests 667 for continuing consent freshness. ICE already requires that 668 implementations respond to such requests, so this approach is 669 maximally compatible. A separate document will profile the ICE 670 timers to be used; see [I-D.muthu-behave-consent-freshness]. 672 5.4. IP Location Privacy 674 A side effect of the default ICE behavior is that the peer learns 675 one's IP address, which leaks large amounts of location information, 676 especially for mobile devices. This has negative privacy 677 consequences in some circumstances. The API requirements in this 678 section are intended to mitigate this issue. Note that these 679 requirements are NOT intended to protect the user's IP address from a 680 malicious site. In general, the site will learn at least a user's 681 server reflexive address from any HTTP transaction. Rather, these 682 requirements are intended to allow a site to cooperate with the user 683 to hide the user's IP address from the other side of the call. 684 Hiding the user's IP address from the server requires some sort of 685 explicit privacy preserving mechanism on the client (e.g., Torbutton 686 [https://www.torproject.org/torbutton/]) and is out of scope for this 687 specification. 689 API Requirement: The API MUST provide a mechanism to allow the JS to 690 suppress ICE negotiation (though perhaps to allow candidate 691 gathering) until the user has decided to answer the call [note: 692 determining when the call has been answered is a question for the 693 JS.] This enables a user to prevent a peer from learning their IP 694 address if they elect not to answer a call and also from learning 695 whether the user is online. 697 API Requirement: The API MUST provide a mechanism for the calling 698 application JS to indicate that only TURN candidates are to be 699 used. This prevents the peer from learning one's IP address at 700 all. 702 API Requirement: The API MUST provide a mechanism for the calling 703 application to reconfigure an existing call to add non-TURN 704 candidates. Taken together, this and the previous requirement 705 allow ICE negotiation to start immediately on incoming call 706 notification, thus reducing post-dial delay, but also to avoid 707 disclosing the user's IP address until they have decided to 708 answer. They also allow users to completely hide their IP address 709 for the duration of the call. Finally, they allow a mechanism for 710 the user to optimize performance by reconfiguring to allow non- 711 turn candidates during an active call if the user decides they no 712 longer need to hide their IP address 714 5.5. Communications Security 716 Implementations MUST implement DTLS [RFC4347] and DTLS-SRTP 717 [RFC5763][RFC5764]. All data channels MUST be secured via DTLS. 718 DTLS-SRTP MUST be offered for every media channel and MUST be the 719 default; i.e., if an implementation receives an offer for DTLS-SRTP 720 and SDES, DTLS-SRTP MUST be selected. Media traffic MUST NOT be sent 721 over plain (unencrypted) RTP. 723 [OPEN ISSUE: What should the settings be here? MUST?] 724 Implementations MAY support SDES for media traffic for backward 725 compatibility purposes. 727 API Requirement: The API MUST provide a mechanism to indicate that a 728 fresh DTLS key pair is to be generated for a specific call. This 729 is intended to allow for unlinkability. Note that there are also 730 settings where it is attractive to use the same keying material 731 repeatedly, especially those with key continuity-based 732 authentication. 734 API Requirement: When DTLS-SRTP is used, the API MUST NOT permit the 735 JS to obtain the negotiated keying material. This requirement 736 preserves the end-to-end security of the media. 738 UI Requirements: A user-oriented client MUST provide an 739 "inspector" interface which allows the user to determine the 740 security characteristics of the media. [largely derived from 741 [I-D.kaufman-rtcweb-security-ui] 742 The following properties SHOULD be displayed "up-front" in the 743 browser chrome, i.e., without requiring the user to ask for them: 745 * A client MUST provide a user interface through which a user may 746 determine the security characteristics for currently-displayed 747 audio and video stream(s) 748 * A client MUST provide a user interface through which a user may 749 determine the security characteristics for transmissions of 750 their microphone audio and camera video. 751 * The "security characteristics" MUST include an indication as to 752 whether the cryptographic keys were delivered out-of-band (from 753 a server) or were generated as a result of a pairwise 754 negotiation. 755 * If the far endpoint was directly verified, either via a third- 756 party verifiable X.509 certificate or via a Web IdP mechanism 757 (see Section 5.6) the "security characteristics" MUST include 758 the verified information. X.509 identities and Web IdP 759 identities have similar semantics and should be displayed in a 760 similar way. 762 The following properties are more likely to require some "drill- 763 down" from the user: 765 * The "security characteristics" MUST indicate the cryptographic 766 algorithms in use (For example: "AES-CBC" or "Null Cipher".) 767 * The "security characteristics" MUST indicate whether PFS is 768 provided. 769 * The "security characteristics" MUST include some mechanism to 770 allow an out-of-band verification of the peer, such as a 771 certificate fingerprint or an SAS. 773 5.6. Web-Based Peer Authentication 775 In a number of cases, it is desirable for the endpoint (i.e., the 776 browser) to be able to directly identity the endpoint on the other 777 side without trusting only the signaling service to which they are 778 connected. For instance, users may be making a call via a federated 779 system where they wish to get direct authentication of the other 780 side. Alternately, they may be making a call on a site which they 781 minimally trust (such as a poker site) but to someone who has an 782 identity on a site they do trust (such as a social network.) 784 Recently, a number of Web-based identity technologies (OAuth, 785 BrowserID, Facebook Connect), etc. have been developed. While the 786 details vary, what these technologies share is that they have a Web- 787 based (i.e., HTTP/HTTPS) identity provider which attests to your 788 identity. For instance, if I have an account at example.org, I could 789 use the example.org identity provider to prove to others that I was 790 alice@example.org. The development of these technologies allows us 791 to separate calling from identity provision: I could call you on 792 Poker Galaxy but identify myself as alice@example.org. 794 Whatever the underlying technology, the general principle is that the 795 party which is being authenticated is NOT the signaling site but 796 rather the user (and their browser). Similarly, the relying party is 797 the browser and not the signaling site. Thus, the browser MUST 798 securely generate the input to the IdP assertion process and MUST 799 securely display the results of the verification process to the user 800 in a way which cannot be imitated by the calling site. 802 The mechanisms defined in this document do not require the browser to 803 implement any particular identity protocol or to support any 804 particular IdP. Instead, this document provides a generic interface 805 which any IdP can implement. Thus, new IdPs and protocols can be 806 introduced without change to either the browser or the calling 807 service. This avoids the need to make a commitment to any particular 808 identity protocol, although browsers may opt to directly implement 809 some identity protocols in order to provide superior performance or 810 UI properties. 812 5.6.1. Trust Relationships: IdPs, APs, and RPs 814 Any federated identity protocol has three major participants: 816 Authenticating Party (AP): The entity which is trying to establish 817 its identity. 819 Identity Provider (IdP): The entity which is vouching for the AP's 820 identity. 822 Relying Party (RP): The entity which is trying to verify the AP's 823 identity. 825 The AP and the IdP have an account relationship of some kind: the AP 826 registers with the IdP and is able to subsequently authenticate 827 directly to the IdP (e.g., with a password). This means that the 828 browser must somehow know which IdP(s) the user has an account 829 relationship with. This can either be something that the user 830 configures into the browser or that is configured at the calling site 831 and then provided to the PeerConnection by the Web application at the 832 calling site. The use case for having this information configured 833 into the browser is that the user may "log into" the browser to bind 834 it to some identity. This is becoming common in new browsers. 835 However, it should also be possible for the IdP information to simply 836 be provided by the calling application. 838 At a high level there are two kinds of IdPs: 840 Authoritative: IdPs which have verifiable control of some section 841 of the identity space. For instance, in the realm of e-mail, the 842 operator of "example.com" has complete control of the namespace 843 ending in "@example.com". Thus, "alice@example.com" is whoever 844 the operator says it is. Examples of systems with authoritative 845 identity providers include DNSSEC, RFC 4474, and Facebook Connect 846 (Facebook identities only make sense within the context of the 847 Facebook system). 849 Third-Party: IdPs which don't have control of their section of the 850 identity space but instead verify user's identities via some 851 unspecified mechanism and then attest to it. Because the IdP 852 doesn't actually control the namespace, RPs need to trust that the 853 IdP is correctly verifying AP identities, and there can 854 potentially be multiple IdPs attesting to the same section of the 855 identity space. Probably the best-known example of a third-party 856 identity provider is SSL certificates, where there are a large 857 number of CAs all of whom can attest to any domain name. 859 If an AP is authenticating via an authoritative IdP, then the RP does 860 not need to explicitly configure trust in the IdP at all. The 861 identity mechanism can directly verify that the IdP indeed made the 862 relevant identity assertion (a function provided by the mechanisms in 863 this document), and any assertion it makes about an identity for 864 which it is authoritative is directly verifiable. Note that this 865 does not mean that the IdP might not lie, but that is a 866 trustworthiness judgement that the user can make at the time he looks 867 at the identity. 869 By contrast, if an AP is authenticating via a third-party IdP, the RP 870 needs to explicitly trust that IdP (hence the need for an explicit 871 trust anchor list in PKI-based SSL/TLS clients). The list of 872 trustable IdPs needs to be configured directly into the browser, 873 either by the user or potentially by the browser manufacturer. This 874 is a significant advantage of authoritative IdPs and implies that if 875 third-party IdPs are to be supported, the potential number needs to 876 be fairly small. 878 5.6.2. Overview of Operation 880 In order to provide security without trusting the calling site, the 881 PeerConnection component of the browser must interact directly with 882 the IdP. The details of the mechanism are described in the W3C API 883 specification, but the general idea is that the PeerConnection 884 component downloads JS from a specific location on the IdP dictated 885 by the IdP domain name. That JS (the "IdP proxy") runs in an 886 isolated security context within the browser and the PeerConnection 887 talks to it via a secure message passing channel. 889 Note that there are two logically separate functions here: 891 o Identity assertion generation. 892 o Identity assertion verification. 894 The same IdP JS "endpoint" is used for both functions but of course a 895 given IdP might behave differently and load new JS to perform one 896 function or the other. 898 +------------------------------------+ 899 | https://calling-site.example.com | 900 | | 901 | | 902 | | 903 | Calling JS Code | 904 | ^ | 905 | | API Calls | 906 | v | 907 | PeerConnection | 908 | ^ | 909 | | postMessage() | 910 | v | 911 | +-------------------------+ | +---------------+ 912 | | https://idp.example.org | | | | 913 | | |<--------->| Identity | 914 | | IdP JS | | | Provider | 915 | | | | | | 916 | +-------------------------+ | +---------------+ 917 | | 918 +------------------------------------+ 920 When the PeerConnection object wants to interact with the IdP, the 921 sequence of events is as follows: 923 1. The browser (the PeerConnection component) instantiates an IdP 924 proxy with its source at the IdP. This allows the IdP to load 925 whatever JS is necessary into the proxy, which runs in the IdP's 926 security context. 927 2. If the user is not already logged in, the IdP does whatever is 928 required to log them in, such as soliciting a username and 929 password. 930 3. Once the user is logged in, the IdP proxy notifies the browser 931 that it is ready. 932 4. The browser and the IdP proxy communicate via a standardized 933 series of messages delivered via postMessage. For instance, the 934 browser might request the IdP proxy to sign or verify a given 935 identity assertion. 937 This approach allows us to decouple the browser from any particular 938 identity provider; the browser need only know how to load the IdP's 939 JavaScript--which is deterministic from the IdP's identity--and the 940 generic protocol for requesting and verifying assertions. The IdP 941 provides whatever logic is necessary to bridge the generic protocol 942 to the IdP's specific requirements. Thus, a single browser can 943 support any number of identity protocols, including being forward 944 compatible with IdPs which did not exist at the time the browser was 945 written. 947 5.6.3. Items for Standardization 949 In order to make this work, we must standardize the following items: 951 o The precise information from the signaling message that must be 952 cryptographically bound to the user's identity and a mechanism for 953 carrying assertions in JSEP messages. Section 5.6.4 954 o The interface to the IdP. Section 5.6.5 specifies a specific 955 protocol mechanism which allows the use of any identity protocol 956 without requiring specific further protocol support in the browser 957 o The JavaScript interfaces which the calling application can use to 958 specify the IdP to use to generate assertions and to discover what 959 assertions were received. 961 The first two items are defined in this document. The final one is 962 defined in the companion W3C WebRTC API specification [TODO:REF] 964 5.6.4. Binding Identity Assertions to JSEP Offer/Answer Transactions 966 5.6.4.1. Input to Assertion Generation Process 968 As discussed above, an identity assertion binds the user's identity 969 (as asserted by the IdP) to the JSEP offer/exchange transaction and 970 specifically to the media. In order to achieve this, the 971 PeerConnection must provide the DTLS-SRTP fingerprint to be bound to 972 the identity. This is provided in a JSON structure for 973 extensibility, as shown below: 975 { 976 "fingerprint" : 977 { 978 "algorithm":"SHA-1", 979 "digest":"4A:AD:B9:B1:3F:...:E5:7C:AB" 980 } 981 } 983 The "algorithm" and digest values correspond directly to the 984 algorithm and digest in the a=fingerprint line of the SDP. 986 Note: this structure does not need to be interpreted by the IdP or 987 the IdP proxy. It is consumed solely by the RP's browser. The IdP 988 merely treats it as an opaque value to be attested to. Thus, new 989 parameters can be added to the assertion without modifying the IdP. 991 5.6.4.2. Carrying Identity Assertions 993 Once an IdP has generated an assertion, it is attached to the JSEP 994 message. This is done by adding a new a-line to the SDP, of the form 995 a=identity. The sole contents of this value are a base-64-encoded 996 version of the identity assertion. For example: 998 v=0 999 o=- 1181923068 1181923196 IN IP4 ua1.example.com 1000 s=example1 1001 c=IN IP4 ua1.example.com 1002 a=setup:actpass 1003 a=fingerprint: SHA-1 \ 1004 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 1005 a=identity: \ 1006 ImlkcCI6eyJkb21haW4iOiAiZXhhbXBsZS5vcmciLCAicHJvdG9jb2wiOiAiYm9n \ 1007 dXMifSwiYXNzZXJ0aW9uIjpcIntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5v \ 1008 cmdcIixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIs \ 1009 XCJzaWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9Cg== 1010 t=0 0 1011 m=audio 6056 RTP/AVP 0 1012 a=sendrecv 1013 a=tcap:1 UDP/TLS/RTP/SAVP RTP/AVP 1014 a=pcfg:1 t=1 1016 Each identity attribute should be paired (and attests to) with an 1017 a=fingerprint attribute and therefore can exist either at the session 1018 or media level. Multiple identity attributes may appear at either 1019 level, though it is RECOMMENDED that implementations not do this, 1020 because it becomes very unclear what security claim that they are 1021 making and the UI guidelines above become unclear. Browsers MAY 1022 choose refuse to display any identity indicators in the face of 1023 multiple identity attributes with different identities but SHOULD 1024 process multiple attributes with the same identity as described 1025 above. 1027 5.6.5. IdP Interaction Details 1029 5.6.5.1. General Message Structure 1031 Messages between the PeerConnection object and the IdP proxy are 1032 formatted using JSON [RFC4627]. For instance, the PeerConnection 1033 would request a signature with the following "SIGN" message: 1035 { 1036 "type":"SIGN", 1037 "id": "1", 1038 "origin":"https://calling-site.example.com", 1039 "message":"012345678abcdefghijkl" 1040 } 1042 All messages MUST contain a "type" field which indicates the general 1043 meaning of the message. 1045 All requests from the PeerConnection object MUST contain an "id" 1046 field which MUST be unique for that PeerConnection object. Any 1047 responses from the IdP proxy MUST contain the same id in response, 1048 which allows the PeerConnection to correlate requests and responses. 1050 All requests from the PeerConnection object MUST contain an "origin" 1051 field containing the origin of the JS which initiated the PC (i.e., 1052 the URL of the calling site). This origin value can be used by the 1053 IdP to make access control decisions. For instance, an IdP might 1054 only issue identity assertions for certain calling services in the 1055 same way that some IdPs require that relying Web sites have an API 1056 key before learning user identity. 1058 Any message-specific data is carried in a "message" field. Depending 1059 on the message type, this may either be a string or a richer JSON 1060 object. 1062 5.6.5.1.1. Errors 1064 If an error occurs, the IdP sends a message of type "ERROR". The 1065 message MAY have an "error" field containing freeform text data which 1066 containing additional information about what happened. For instance: 1068 { 1069 "type":"ERROR", 1070 "error":"Signature verification failed" 1071 } 1073 Figure 5: Example error 1075 5.6.5.2. IdP Proxy Setup 1077 In order to perform an identity transaction, the PeerConnection must 1078 first create an IdP proxy. While the details of this are specified 1079 in the W3C API document, from the perspective of this specification, 1080 however, the relevant facts are: 1082 o The JS runs in the IdP's security context with the base page 1083 retrieved from the URL specified in Section 5.6.5.2.1 1084 o The usual browser sandbox isolation mechanisms MUST be enforced 1085 with respect to the IdP proxy. 1086 o JS running in the IdP proxy MUST be able to send and receive 1087 messages to the PeerConnection and the PC and IdP proxy are able 1088 to verify the source and destination of these messages. 1090 Initially the IdP proxy is in an unready state; the IdP JS must be 1091 loaded and there may be several round trips to the IdP server, for 1092 instance to log the user in. When the IdP proxy is ready to receive 1093 commands, it delivers a "ready" message. As this message is 1094 unsolicited, it simply contains: 1096 { "type":"READY" } 1098 [[ OPEN ISSUE: if the W3C half of this converges on WebIntents, then 1099 the READY message will not be necessary.]] 1101 Once the PeerConnection object receives the ready message, it can 1102 send commands to the IdP proxy. 1104 5.6.5.2.1. Determining the IdP URI 1106 In order to ensure that the IdP is under control of the domain owner 1107 rather than someone who merely has an account on the domain owner's 1108 server (e.g., in shared hosting scenarios), the IdP JavaScript is 1109 hosted at a deterministic location based on the IdP's domain name. 1110 Each IdP proxy instance is associated with two values: 1112 domain name: The IdP's domain name 1113 protocol: The specific IdP protocol which the IdP is using. This is 1114 a completely IdP-specific string, but allows an IdP to implement 1115 two protocols in parallel. This value may be the empty string. 1117 Each IdP MUST serve its initial entry page (i.e., the one loaded by 1118 the IdP proxy) from the well-known URI specified in "/.well-known/ 1119 idp-proxy/" on the IdP's web site. This URI MUST be loaded 1120 via HTTPS [RFC2818]. For example, for the IdP "identity.example.com" 1121 and the protocol "example", the URL would be: 1123 https://example.com/.well-known/idp-proxy/example 1125 5.6.5.2.1.1. Authenticating Party 1127 How an AP determines the appropriate IdP domain is out of scope of 1128 this specification. In general, however, the AP has some actual 1129 account relationship with the IdP, as this identity is what the IdP 1130 is attesting to. Thus, the AP somehow supplies the IdP information 1131 to the browser. Some potential mechanisms include: 1133 o Provided by the user directly. 1134 o Selected from some set of IdPs known to the calling site. E.g., a 1135 button that shows "Authenticate via Facebook Connect" 1137 5.6.5.2.1.2. Relying Party 1139 Unlike the AP, the RP need not have any particular relationship with 1140 the IdP. Rather, it needs to be able to process whatever assertion 1141 is provided by the AP. As the assertion contains the IdP's identity, 1142 the URI can be constructed directly from the assertion, and thus the 1143 RP can directly verify the technical validity of the assertion with 1144 no user interaction. Authoritative assertions need only be 1145 verifiable. Third-party assertions also MUST be verified against 1146 local policy, as described in Section 5.6.5.2.3.1. 1148 5.6.5.2.2. Requesting Assertions 1150 In order to request an assertion, the PeerConnection sends a "SIGN" 1151 message. Aside from the mandatory fields, this message has a 1152 "message" field containing a string. The contents of this string are 1153 defined above, but are opaque from the perspective of the IdP. 1155 A successful response to a "SIGN" message contains a message field 1156 which is a JS dictionary dictionary consisting of two fields: 1158 idp: A dictionary containing the domain name of the provider and the 1159 protocol string 1160 assertion: An opaque field containing the assertion itself. This is 1161 only interpretable by the idp or its proxy. 1163 Figure 6 shows an example transaction, with the message "abcde..." 1164 (remember, the messages are opaque at this layer) being signed and 1165 bound to identity "ekr@example.org". In this case, the message has 1166 presumably been digitally signed/MACed in some way that the IdP can 1167 later verify it, but this is an implementation detail and out of 1168 scope of this document. Line breaks are inserted solely for 1169 readability. 1171 PeerConnection -> IdP proxy: 1172 { 1173 "type":"SIGN", 1174 "id":1, 1175 "origin":"https://calling-service.example.com/", 1176 "message":"abcdefghijklmnopqrstuvwyz" 1177 } 1179 IdPProxy -> PeerConnection: 1180 { 1181 "type":"SUCCESS", 1182 "id":1, 1183 "message": { 1184 "idp":{ 1185 "domain": "example.org" 1186 "protocol": "bogus" 1187 }, 1188 "assertion":\"{\"identity\":\"bob@example.org\", 1189 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1190 \"request_origin\":\"rtcweb://peerconnection\", 1191 \"signature\":\"010203040506\"}" 1192 } 1193 } 1195 Figure 6: Example assertion request 1197 5.6.5.2.3. Verifying Assertions 1199 In order to verify an assertion, an RP sends a "VERIFY" message to 1200 the IdP proxy containing the assertion supplied by the AP in the 1201 "message" field. 1203 The IdP proxy verifies the assertion. Depending on the identity 1204 protocol, this may require one or more round trips to the IdP. For 1205 instance, an OAuth-based protocol will likely require using the IdP 1206 as an oracle, whereas with BrowserID the IdP proxy can likely verify 1207 the signature on the assertion without contacting the IdP, provided 1208 that it has cached the IdP's public key. 1210 Regardless of the mechanism, if verification succeeds, a successful 1211 response from the IdP proxy MUST contain a message field consisting 1212 of a dictionary/hash with the following fields: 1214 identity The identity of the AP from the IdP's perspective. Details 1215 of this are provided in Section 5.6.5.2.3.1 1216 contents The original unmodified string provided by the AP in the 1217 original SIGN request. 1218 request_origin The original origin of the SIGN request on the AP 1219 side as determined by the origin of the PostMessage call. The IdP 1220 MUST somehow arrange to propagate this information as part of the 1221 assertion. The receiving PeerConnection MUST verify that this 1222 value is "rtcweb://peerconnection" (which implies that 1223 PeerConnection must arrange that its messages to the IdP proxy are 1224 from this origin.) [[ OPEN ISSUE: Can a URI person help make a 1225 better URI.]] 1227 Figure 7 shows an example transaction. Line breaks are inserted 1228 solely for readability. 1230 PeerConnection -> IdP Proxy: 1231 { 1232 "type":"VERIFY", 1233 "id":2, 1234 "origin":"https://calling-service.example.com/", 1235 "message":\"{\"identity\":\"bob@example.org\", 1236 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1237 \"request_origin\":\"rtcweb://peerconnection\", 1238 \"signature\":\"010203040506\"}" 1239 } 1241 IdP Proxy -> PeerConnection: 1242 { 1243 "type":"SUCCESS", 1244 "id":2, 1245 "message": { 1246 "identity" : { 1247 "name" : "bob@example.org", 1248 "displayname" : "Bob" 1249 }, 1250 "request_origin":"rtcweb://peerconnection", 1251 "contents":"abcdefghijklmnopqrstuvwyz" 1252 } 1253 } 1255 Figure 7: Example verification request 1257 5.6.5.2.3.1. Identity Formats 1259 Identities passed from the IdP proxy to the PeerConnection are 1260 structured as JSON dictionaries with one mandatory field: "name". 1261 This field MUST consist of an RFC822-formatted string representing 1262 the user's identity. [[ OPEN ISSUE: Would it be better to have a 1263 typed field? ]] The PeerConnection API MUST check this string as 1264 follows: 1266 1. If the RHS of the string is equal to the domain name of the IdP 1267 proxy, then the assertion is valid, as the IdP is authoritative 1268 for this domain. 1269 2. If the RHS of the string is not equal to the domain name of the 1270 IdP proxy, then the PeerConnection object MUST reject the 1271 assertion unless (a) the IdP domain is listed as an acceptable 1272 third-party IdP and (b) local policy is configured to trust this 1273 IdP domain for the RHS of the identity string. 1275 Sites which have identities that do not fit into the RFC822 style 1276 (for instance, Facebook ids are simple numeric values) SHOULD convert 1277 them to this form by appending their IdP domain (e.g., 1278 12345@identity.facebook.com), thus ensuring that they are 1279 authoritative for the identity. 1281 The IdP proxy MAY also include a "displayname" field which contains a 1282 more user-friendly identity assertion. Browsers SHOULD take care in 1283 the UI to distinguish the "name" assertion which is verifiable 1284 directly from the "displayname" which cannot be verified and thus 1285 relies on trust in the IdP. In future, we may define other fields to 1286 allow the IdP to provide more information to the browser. [[OPEN 1287 ISSUE: Should this field exist? Is it confusing? ]] 1289 5.7. Security Considerations 1291 Much of the security analysis of this problem is contained in 1292 [I-D.ietf-rtcweb-security] or in the discussion of the particular 1293 issues above. In order to avoid repetition, this section focuses on 1294 (a) residual threats that are not addressed by this document and (b) 1295 threats produced by failure/misbehavior of one of the components in 1296 the system. 1298 5.7.1. Communications Security 1300 While this document favors DTLS-SRTP, it permits a variety of 1301 communications security mechanisms and thus the level of 1302 communications security actually provided varies considerably. Any 1303 pair of implementations which have multiple security mechanisms in 1304 common are subject to being downgraded to the weakest of those common 1305 mechanisms by any attacker who can modify the signaling traffic. If 1306 communications are over HTTP, this means any on-path attacker. If 1307 communications are over HTTPS, this means the signaling server. 1308 Implementations which wish to avoid downgrade attack should only 1309 offer the strongest available mechanism, which is DTLS/DTLS-SRTP. 1310 Note that the implication of this choice will be that interop to non- 1311 DTLS-SRTP devices will need to happen through gateways. 1313 Even if only DTLS/DTLS-SRTP are used, the signaling server can 1314 potentially mount a man-in-the-middle attack unless implementations 1315 have some mechanism for independently verifying keys. The UI 1316 requirements in Section 5.5 are designed to provide such a mechanism 1317 for motivated/security conscious users, but are not suitable for 1318 general use. The identity service mechanisms in Section 5.6 are more 1319 suitable for general use. Note, however, that a malicious signaling 1320 service can strip off any such identity assertions, though it cannot 1321 forge new ones. Note that all of the third-party security mechanisms 1322 available (whether X.509 certificates or a third-party IdP) rely on 1323 the security of the third party--this is of course also true of your 1324 connection to the Web site itself. Users who wish to assure 1325 themselves of security against a malicious identity provider can only 1326 do so by verifying peer credentials directly, e.g., by checking the 1327 peer's fingerprint against a value delivered out of band. 1329 In order to protect against malicious content JavaScript, that 1330 JavaScript MUST NOT be allowed to have direct access to---or perform 1331 computations with---DTLS keys. For instance, if content JS were able 1332 to compute digital signatures, then it would be possible for content 1333 JS to get an identity assertion for a browser's generated key and 1334 then use that assertion plus a signature by the key to authenticate a 1335 call protected under an ephemeral DH key controlled by the content 1336 JS, thus violating the security guarantees otherwise provided by the 1337 IdP mechanism. Note that it is not sufficient merely to deny the 1338 content JS direct access to the keys, as some have suggested doing 1339 with the WebCrypto API. The JS must also not be allowed to perform 1340 operations that would be valid for a DTLS endpoint. By far the 1341 safest approach is simply to deny the ability to perform any 1342 operations that depend on secret information associated with the key. 1343 Operations that depend on public information, such as exporting the 1344 public key are of course safe. 1346 5.7.2. Privacy 1348 The requirements in this document are intended to allow: 1350 o Users to participate in calls without revealing their location. 1352 o Potential callees to avoid revealing their location and even 1353 presence status prior to agreeing to answer a call. 1355 However, these privacy protections come at a performance cost in 1356 terms of using TURN relays and, in the latter case, delaying ICE. 1357 Sites SHOULD make users aware of these tradeoffs. 1359 Note that the protections provided here assume a non-malicious 1360 calling service. As the calling service always knows the users 1361 status and (absent the use of a technology like Tor) their IP 1362 address, they can violate the users privacy at will. Users who wish 1363 privacy against the calling sites they are using must use separate 1364 privacy enhancing technologies such as Tor. Combined RTCWEB/Tor 1365 implementations SHOULD arrange to route the media as well as the 1366 signaling through Tor. [Currently this will produce very suboptimal 1367 performance.] 1369 5.7.3. Denial of Service 1371 The consent mechanisms described in this document are intended to 1372 mitigate denial of service attacks in which an attacker uses clients 1373 to send large amounts of traffic to a victim without the consent of 1374 the victim. While these mechanisms are sufficient to protect victims 1375 who have not implemented RTCWEB at all, RTCWEB implementations need 1376 to be more careful. 1378 Consider the case of a call center which accepts calls via RTCWeb. 1379 An attacker proxies the call center's front-end and arranges for 1380 multiple clients to initiate calls to the call center. Note that 1381 this requires user consent in many cases but because the data channel 1382 does not need consent, he can use that directly. Since ICE will 1383 complete, browsers can then be induced to send large amounts of data 1384 to the victim call center if it supports the data channel at all. 1385 Preventing this attack requires that automated RTCWEB 1386 implemementations implement sensible flow control and have the 1387 ability to triage out (i.e., stop responding to ICE probes on) calls 1388 which are behaving badly, and especially to be prepared to remotely 1389 throttle the data channel in the absence of plausible audio and video 1390 (which the attacker cannot control). 1392 Another related attack is for the signaling service to swap the ICE 1393 candidates for the audio and video streams, thus forcing a browser to 1394 send video to the sink that the other victim expects will contain 1395 audio (perhaps it is only expecting audio!) potentially causing 1396 overload. Muxing multiple media flows over a single transport makes 1397 it harder to individually suppress a single flow by denying ICE 1398 keepalives. Either media-level (RTCP) mechanisms must be used or the 1399 implementation must deny responses entirely, thus termnating the 1400 call. 1402 Yet another attack, suggested by Magnus Westerlund, is for the 1403 attacker to cross-connect offers and answers as follows. It induces 1404 the victim to make a call and then uses its control of other users 1405 browsers to get them to attempt a call to someone. It then 1406 translates their offers into apparent answers to the victim, which 1407 looks like large-scale parallel forking. The victim still responds 1408 to ICE responses and now the browsers all try to send media to the 1409 victim. Implementations can defend themselves from this attack by 1410 only responding to ICE Binding Requests for a limited number of 1411 remote ufrags (this is the reason for the requirement that the JS not 1412 be able to control the ufrag and password). 1414 Note that attacks based on confusing one end or the other about 1415 consent are possible even in the face of the third-party identity 1416 mechanism as long as major parts of the signaling messages are not 1417 signed. On the other hand, signing the entire message severely 1418 restricts the capabilities of the calling application, so there are 1419 difficult tradeoffs here. 1421 5.7.4. IdP Authentication Mechanism 1423 This mechanism relies for its security on the IdP and on the 1424 PeerConnection correctly enforcing the security invariants described 1425 above. At a high level, the IdP is attesting that the user 1426 identified in the assertion wishes to be associated with the 1427 assertion. Thus, it must not be possible for arbitrary third parties 1428 to get assertions tied to a user or to produce assertions that RPs 1429 will accept. 1431 5.7.4.1. PeerConnection Origin Check 1433 Fundamentally, the IdP proxy is just a piece of HTML and JS loaded by 1434 the browser, so nothing stops a Web attacker o from creating their 1435 own IFRAME, loading the IdP proxy HTML/JS, and requesting a 1436 signature. In order to prevent this attack, we require that all 1437 signatures be tied to a specific origin ("rtcweb://...") which cannot 1438 be produced by content JavaScript. Thus, while an attacker can 1439 instantiate the IdP proxy, they cannot send messages from an 1440 appropriate origin and so cannot create acceptable assertions. I.e., 1441 the assertion request must have come from the browser. This origin 1442 check is enforced on the relying party side, not on the 1443 authenticating party side. The reason for this is to take the burden 1444 of knowing which origins are valid off of the IdP, thus making this 1445 mechanism extensible to other applications besides RTCWEB. The IdP 1446 simply needs to gather the origin information (from the posted 1447 message) and attach it to the assertion. 1449 Note that although this origin check is enforced on the RP side and 1450 not at the IdP, it is absolutely imperative that it be done. The 1451 mechanisms in this document rely on the browser enforcing access 1452 restrictions on the DTLS keys and assertion requests which do not 1453 come with the right origin may be from content JS rather than from 1454 browsers, and therefore those access restrcitions cannot be assumed. 1456 Note that this check only asserts that the browser (or some other 1457 entity with access to the user's authentication data) attests to the 1458 request and hence to the fingerprint. It does not demonstrate that 1459 the browser has access to the associated private key. However, 1460 attaching one's identity to a key that the user does not control does 1461 not appear to provide substantial leverage to an attacker, so a proof 1462 of possession is omitted for simplicity. 1464 5.7.4.2. IdP Well-known URI 1466 As described in Section 5.6.5.2.1 the IdP proxy HTML/JS landing page 1467 is located at a well-known URI based on the IdP's domain name. This 1468 requirement prevents an attacker who can write some resources at the 1469 IdP (e.g., on one's Facebook wall) from being able to impersonate the 1470 IdP. 1472 5.7.4.3. Privacy of IdP-generated identities and the hosting site 1474 Depending on the structure of the IdP's assertions, the calling site 1475 may learn the user's identity from the perspective of the IdP. In 1476 many cases this is not an issue because the user is authenticating to 1477 the site via the IdP in any case, for instance when the user has 1478 logged in with Facebook Connect and is then authenticating their call 1479 with a Facebook identity. However, in other case, the user may not 1480 have already revealed their identity to the site. In general, IdPs 1481 SHOULD either verify that the user is willing to have their identity 1482 revealed to the site (e.g., through the usual IdP permissions dialog) 1483 or arrange that the identity information is only available to known 1484 RPs (e.g., social graph adjacencies) but not to the calling site. 1485 The "origin" field of the signature request can be used to check that 1486 the user has agreed to disclose their identity to the calling site; 1487 because it is supplied by the PeerConnection it can be trusted to be 1488 correct. 1490 5.7.4.4. Security of Third-Party IdPs 1492 As discussed above, each third-party IdP represents a new universal 1493 trust point and therefore the number of these IdPs needs to be quite 1494 limited. Most IdPs, even those which issue unqualified identities 1495 such as Facebook, can be recast as authoritative IdPs (e.g., 1496 123456@facebook.com). However, in such cases, the user interface 1497 implications are not entirely desirable. One intermediate approach 1498 is to have special (potentially user configurable) UI for large 1499 authoritative IdPs, thus allowing the user to instantly grasp that 1500 the call is being authenticated by Facebook, Google, etc. 1502 5.7.4.5. Web Security Feature Interactions 1504 A number of optional Web security features have the potential to 1505 cause issues for this mechanism, as discussed below. 1507 5.7.4.5.1. Popup Blocking 1509 If the user is not already logged into the IdP, the IdP proxy may 1510 need to pop up a top level window in order to prompt the user for 1511 their authentication information (it is bad practice to do this in an 1512 IFRAME inside the window because then users have no way to determine 1513 the destination for their password). If the user's browser is 1514 configured to prevent popups, this may fail (depending on the exact 1515 algorithm that the popup blocker uses to suppress popups). It may be 1516 necessary to provide a standardized mechanism to allow the IdP proxy 1517 to request popping of a login window. Note that care must be taken 1518 here to avoid PeerConnection becoming a general escape hatch from 1519 popup blocking. One possibility would be to only allow popups when 1520 the user has explicitly registered a given IdP as one of theirs (this 1521 is only relevant at the AP side in any case). This is what 1522 WebIntents does, and the problem would go away if WebIntents is used. 1524 5.7.4.5.2. Third Party Cookies 1526 Some browsers allow users to block third party cookies (cookies 1527 associated with origins other than the top level page) for privacy 1528 reasons. Any IdP which uses cookies to persist logins will be broken 1529 by third-party cookie blocking. One option is to accept this as a 1530 limitation; another is to have the PeerConnection object disable 1531 third-party cookie blocking for the IdP proxy. 1533 6. Acknowledgements 1535 Bernard Aboba, Harald Alvestrand, Richard Barnes, Dan Druta, Cullen 1536 Jennings, Hadriel Kaplan, Matthew Kaufman, Jim McEachern, Martin 1537 Thomson, Magnus Westerland. 1539 7. Changes 1540 7.1. Changes since -05 1542 The following changes have been made since the -05 draft. 1544 o Response to comments from Richard Barnes 1545 o More explanation of the IdP security properties and the federation 1546 use case. 1547 o Editorial cleanup. 1549 7.2. Changes since -03 1551 Version -04 was a version control mistake. Please ignore. 1553 The following changes have been made since the -04 draft. 1555 o Move origin check from IdP to RP per discussion in YVR. 1556 o Clarified treatment of X.509-level identities. 1557 o Editorial cleanup. 1559 7.3. Changes since -03 1561 7.4. Changes since -02 1563 The following changes have been made since the -02 draft. 1565 o Forbid persistent HTTP permissions. 1566 o Clarified the text in S 5.4 to clearly refer to requirements on 1567 the API to provide functionality to the site. 1568 o Fold in the IETF portion of draft-rescorla-rtcweb-generic-idp 1569 o Retarget the continuing consent section to assume Binding Requests 1570 o Editorial improvements 1572 8. References 1574 8.1. Normative References 1576 [I-D.ietf-rtcweb-security] 1577 Rescorla, E., "Security Considerations for RTC-Web", 1578 draft-ietf-rtcweb-security-03 (work in progress), 1579 June 2012. 1581 [I-D.muthu-behave-consent-freshness] 1582 Perumal, M., Wing, D., R, R., and H. Kaplan, "STUN Usage 1583 for Consent Freshness", 1584 draft-muthu-behave-consent-freshness-02 (work in 1585 progress), January 2013. 1587 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1588 Requirement Levels", BCP 14, RFC 2119, March 1997. 1590 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1592 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1593 Security", RFC 4347, April 2006. 1595 [RFC4627] Crockford, D., "The application/json Media Type for 1596 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1598 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1599 (ICE): A Protocol for Network Address Translator (NAT) 1600 Traversal for Offer/Answer Protocols", RFC 5245, 1601 April 2010. 1603 [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework 1604 for Establishing a Secure Real-time Transport Protocol 1605 (SRTP) Security Context Using Datagram Transport Layer 1606 Security (DTLS)", RFC 5763, May 2010. 1608 [RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer 1609 Security (DTLS) Extension to Establish Keys for the Secure 1610 Real-time Transport Protocol (SRTP)", RFC 5764, May 2010. 1612 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 1613 December 2011. 1615 8.2. Informative References 1617 [I-D.ietf-rtcweb-jsep] 1618 Uberti, J. and C. Jennings, "Javascript Session 1619 Establishment Protocol", draft-ietf-rtcweb-jsep-02 (work 1620 in progress), October 2012. 1622 [I-D.jennings-rtcweb-signaling] 1623 Jennings, C., Rosenberg, J., and R. Jesup, "RTCWeb Offer/ 1624 Answer Protocol (ROAP)", 1625 draft-jennings-rtcweb-signaling-01 (work in progress), 1626 October 2011. 1628 [I-D.kaufman-rtcweb-security-ui] 1629 Kaufman, M., "Client Security User Interface Requirements 1630 for RTCWEB", draft-kaufman-rtcweb-security-ui-00 (work in 1631 progress), June 2011. 1633 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1634 A., Peterson, J., Sparks, R., Handley, M., and E. 1636 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1637 June 2002. 1639 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1640 Layer Security (TLS)", RFC 5705, March 2010. 1642 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", 1643 RFC 6455, December 2011. 1645 [XmlHttpRequest] 1646 van Kesteren, A., "XMLHttpRequest Level 2". 1648 Appendix A. Example IdP Bindings to Specific Protocols 1650 This section provides some examples of how the mechanisms described 1651 in this document could be used with existing authentication protocols 1652 such as BrowserID or OAuth. Note that this does not require browser- 1653 level support for either protocol. Rather, the protocols can be fit 1654 into the generic framework. (Though BrowserID in particular works 1655 better with some client side support). 1657 A.1. BrowserID 1659 BrowserID [https://browserid.org/] is a technology which allows a 1660 user with a verified email address to generate an assertion 1661 (authenticated by their identity provider) attesting to their 1662 identity (phrased as an email address). The way that this is used in 1663 practice is that the relying party embeds JS in their site which 1664 talks to the BrowserID code (either hosted on a trusted intermediary 1665 or embedded in the browser). That code generates the assertion which 1666 is passed back to the relying party for verification. The assertion 1667 can be verified directly or with a Web service provided by the 1668 identity provider. It's relatively easy to extend this functionality 1669 to authenticate RTCWEB calls, as shown below. 1671 +----------------------+ +----------------------+ 1672 | | | | 1673 | Alice's Browser | | Bob's Browser | 1674 | | OFFER ------------> | | 1675 | Calling JS Code | | Calling JS Code | 1676 | ^ | | ^ | 1677 | | | | | | 1678 | v | | v | 1679 | PeerConnection | | PeerConnection | 1680 | | ^ | | | ^ | 1681 | Finger| |Signed | |Signed | | | 1682 | print | |Finger | |Finger | |"Alice"| 1683 | | |print | |print | | | 1684 | v | | | v | | 1685 | +--------------+ | | +---------------+ | 1686 | | IdP Proxy | | | | IdP Proxy | | 1687 | | to | | | | to | | 1688 | | BrowserID | | | | BrowserID | | 1689 | | Signer | | | | Verifier | | 1690 | +--------------+ | | +---------------+ | 1691 | ^ | | ^ | 1692 +-----------|----------+ +----------|-----------+ 1693 | | 1694 | Get certificate | 1695 v | Check 1696 +----------------------+ | certificate 1697 | | | 1698 | Identity |/-------------------------------+ 1699 | Provider | 1700 | | 1701 +----------------------+ 1703 The way this mechanism works is as follows. On Alice's side, Alice 1704 goes to initiate a call. 1706 1. The calling JS instantiates a PeerConnection and tells it that it 1707 is interested in having it authenticated via BrowserID (i.e., it 1708 provides "browserid.org" as the IdP name.) 1709 2. The PeerConnection instantiates the BrowserID signer in the IdP 1710 proxy 1711 3. The BrowserID signer contacts Alice's identity provider, 1712 authenticating as Alice (likely via a cookie). 1713 4. The identity provider returns a short-term certificate attesting 1714 to Alice's identity and her short-term public key. 1715 5. The Browser-ID code signs the fingerprint and returns the signed 1716 assertion + certificate to the PeerConnection. 1718 6. The PeerConnection returns the signed information to the calling 1719 JS code. 1720 7. The signed assertion gets sent over the wire to Bob's browser 1721 (via the signaling service) as part of the call setup. 1723 Obviously, the format of the signed assertion varies depending on 1724 what signaling style the WG ultimately adopts. However, for 1725 concreteness, if something like ROAP were adopted, then the entire 1726 message might look like: 1728 { 1729 "messageType":"OFFER", 1730 "callerSessionId":"13456789ABCDEF", 1731 "seq": 1 1732 "sdp":" 1733 v=0\n 1734 o=- 2890844526 2890842807 IN IP4 192.0.2.1\n 1735 s= \n 1736 c=IN IP4 192.0.2.1\n 1737 t=2873397496 2873404696\n 1738 m=audio 49170 RTP/AVP 0\n 1739 a=fingerprint: SHA-1 \ 1740 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\n", 1741 "identity":{ 1742 "idp":{ // Standardized 1743 "domain":"browserid.org", 1744 "method":"default" 1745 }, 1746 "assertion": // Contents are browserid-specific 1747 "\"assertion\": { 1748 \"digest\":\"\", 1749 \"audience\": \"[TBD]\" 1750 \"valid-until\": 1308859352261, 1751 }, 1752 \"certificate\": { 1753 \"email\": \"rescorla@example.org\", 1754 \"public-key\": \"\", 1755 \"valid-until\": 1308860561861, 1756 }" // certificate is signed by example.org 1757 } 1758 } 1760 Note that while the IdP here is specified as "browserid.org", the 1761 actual certificate is signed by example.org. This is because 1762 BrowserID is a combined authoritative/third-party system in which 1763 browserid.org delegates the right to be authoritative (what BrowserID 1764 calls primary) to individual domains. 1766 On Bob's side, he receives the signed assertion as part of the call 1767 setup message and a similar procedure happens to verify it. 1769 1. The calling JS instantiates a PeerConnection and provides it the 1770 relevant signaling information, including the signed assertion. 1771 2. The PeerConnection instantiates the IdP proxy which examines the 1772 IdP name and brings up the BrowserID verification code. 1773 3. The BrowserID verifier contacts the identity provider to verify 1774 the certificate and then uses the key to verify the signed 1775 fingerprint. 1776 4. Alice's verified identity is returned to the PeerConnection (it 1777 already has the fingerprint). 1778 5. At this point, Bob's browser can display a trusted UI indication 1779 that Alice is on the other end of the call. 1781 When Bob returns his answer, he follows the converse procedure, which 1782 provides Alice with a signed assertion of Bob's identity and keying 1783 material. 1785 A.2. OAuth 1787 While OAuth is not directly designed for user-to-user authentication, 1788 with a little lateral thinking it can be made to serve. We use the 1789 following mapping of OAuth concepts to RTCWEB concepts: 1791 +----------------------+----------------------+ 1792 | OAuth | RTCWEB | 1793 +----------------------+----------------------+ 1794 | Client | Relying party | 1795 | Resource owner | Authenticating party | 1796 | Authorization server | Identity service | 1797 | Resource server | Identity service | 1798 +----------------------+----------------------+ 1800 Table 1 1802 The idea here is that when Alice wants to authenticate to Bob (i.e., 1803 for Bob to be aware that she is calling). In order to do this, she 1804 allows Bob to see a resource on the identity provider that is bound 1805 to the call, her identity, and her public key. Then Bob retrieves 1806 the resource from the identity provider, thus verifying the binding 1807 between Alice and the call. 1809 Alice IdP Bob 1810 --------------------------------------------------------- 1811 Call-Id, Fingerprint -------> 1812 <------------------- Auth Code 1813 Auth Code ----------------------------------------------> 1814 <----- Get Token + Auth Code 1815 Token ---------------------> 1816 <------------- Get call-info 1817 Call-Id, Fingerprint ------> 1819 This is a modified version of a common OAuth flow, but omits the 1820 redirects required to have the client point the resource owner to the 1821 IdP, which is acting as both the resource server and the 1822 authorization server, since Alice already has a handle to the IdP. 1824 Above, we have referred to "Alice", but really what we mean is the 1825 PeerConnection. Specifically, the PeerConnection will instantiate an 1826 IFRAME with JS from the IdP and will use that IFRAME to communicate 1827 with the IdP, authenticating with Alice's identity (e.g., cookie). 1828 Similarly, Bob's PeerConnection instantiates an IFRAME to talk to the 1829 IdP. 1831 Author's Address 1833 Eric Rescorla 1834 RTFM, Inc. 1835 2064 Edgewood Drive 1836 Palo Alto, CA 94303 1837 USA 1839 Phone: +1 650 678 2350 1840 Email: ekr@rtfm.com