127-dirport-mirrors-downloads.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. Filename: 127-dirport-mirrors-downloads.txt
  2. Title: Relaying dirport requests to Tor download site / website
  3. Author: Roger Dingledine
  4. Created: 2007-12-02
  5. Status: Draft
  6. 1. Overview
  7. Some countries and networks block connections to the Tor website. As
  8. time goes by, this will remain a problem and it may even become worse.
  9. We have a big pile of mirrors (google for "Tor mirrors"), but few of
  10. our users think to try a search like that. Also, many of these mirrors
  11. might be automatically blocked since their pages contain words that
  12. might cause them to get banned. And lastly, we can imagine a future
  13. where the blockers are aware of the mirror list too.
  14. Here we describe a new set of URLs for Tor's DirPort that will relay
  15. connections from users to the official Tor download site. Rather than
  16. trying to cache a bunch of new Tor packages (which is a hassle in terms
  17. of keeping them up to date, and a hassle in terms of drive space used),
  18. we instead just proxy the requests directly to Tor's /dist page.
  19. Specifically, we should support
  20. GET /tor/dist/$1
  21. and
  22. GET /tor/website/$1
  23. 2. Direct connections, one-hop circuits, or three-hop circuits?
  24. We could relay the connections directly to the download site -- but
  25. this produces recognizable outgoing traffic on the bridge or cache's
  26. network, which will probably surprise our nice volunteers. (Is this
  27. a good enough reason to discard the direct connection idea?)
  28. Even if we don't do direct connections, should we do a one-hop
  29. begindir-style connection to the mirror site (make a one-hop circuit
  30. to it, then send a 'begindir' cell down the circuit), or should we do
  31. a normal three-hop anonymized connection?
  32. If these mirrors are mainly bridges, doing either a direct or a one-hop
  33. connection creates another way to enumerate bridges. That would argue
  34. for three-hop. On the other hand, downloading a 10+ megabyte installer
  35. through a normal Tor circuit can't be fun. But if you're already getting
  36. throttled a lot because you're in the "relayed traffic" bucket, you're
  37. going to have to accept a slow transfer anyway. So three-hop it is.
  38. Speaking of which, we would want to label this connection
  39. as "relay" traffic for the purposes of rate limiting; see
  40. connection_counts_as_relayed_traffic() and or_conn->client_used. This
  41. will be a bit tricky though, because these connections will use the
  42. bridge's guards.
  43. 3. Scanning resistance
  44. One other goal we'd like to achieve, or at least not hinder, is making
  45. it hard to scan large swaths of the Internet to look for responses
  46. that indicate a bridge.
  47. In general this is a really hard problem, so we shouldn't demand to
  48. solve it here. But we can note that some bridges should open their
  49. DirPort (and offer this functionality), and others shouldn't. Then
  50. some bridges provide a download mirror while others can remain
  51. scanning-resistant.
  52. 4. Integrity checking
  53. If we serve this stuff in plaintext from the bridge, anybody in between
  54. the user and the bridge can intercept and modify it. The bridge can too.
  55. If we do an anonymized three-hop connection, the exit node can also
  56. intercept and modify the exe it sends back.
  57. Are we setting ourselves up for rogue exit relays, or rogue bridges,
  58. that trojan our users?
  59. Answer #1: Users need to do pgp signature checking. Not a very good
  60. answer, a) because it's complex, and b) because they don't know the
  61. right signing keys in the first place.
  62. Answer #2: The mirrors could exit from a specific Tor relay, using the
  63. '.exit' notation. This would make connections a bit more brittle, but
  64. would resolve the rogue exit relay issue. We could even round-robin
  65. among several, and the list could be dynamic -- for example, all the
  66. relays with an Authority flag that allow exits to the Tor website.
  67. Answer #3: The mirrors should connect to the main distribution site
  68. via SSL. That way the exit relay can't influence anything.
  69. Answer #4: We could suggest that users only use trusted bridges for
  70. fetching a copy of Tor. Hopefully they heard about the bridge from a
  71. trusted source rather than from the adversary.
  72. Answer #5: What if the adversary is trawling for Tor downloads by
  73. network signature -- either by looking for known bytes in the binary,
  74. or by looking for "GET /tor/dist/"? It would be nice to encrypt the
  75. connection from the bridge user to the bridge. And we can! The bridge
  76. already supports TLS. Rather than initiating a TLS renegotiation after
  77. connecting to the ORPort, the user should actually request a URL. Then
  78. the ORPort can either pass the connection off as a linked conn to the
  79. dirport, or renegotiate and become a Tor connection, depending on how
  80. the client behaves.
  81. 5. Linked connections: at what level should we proxy?
  82. Check out the connection_ap_make_link() function, as called from
  83. directory.c. Tor clients use this to create a "fake" socks connection
  84. back to themselves, and then they attach a directory request to it,
  85. so they can launch directory fetches via Tor. We can piggyback on
  86. this feature.
  87. We need to decide if we're going to be passing the bytes back and
  88. forth between the web browser and the main distribution site, or if
  89. we're going to be actually acting like a proxy (parsing out the file
  90. they want, fetching that file, and serving it back).
  91. Advantages of proxying without looking inside:
  92. - We don't need to build any sort of http support (including
  93. continues, partial fetches, etc etc).
  94. Disadvantages:
  95. - If the browser thinks it's speaking http, are there easy ways
  96. to pass the bytes to an https server and have everything work
  97. correctly? At the least, it would seem that the browser would
  98. complain about the cert. More generally, ssl wants to be negotiated
  99. before the URL and headers are sent, yet we need to read the URL
  100. and headers to know that this is a mirror request; so we have an
  101. ordering problem here.
  102. - Makes it harder to do caching later on, if we don't look at what
  103. we're relaying. (It might be useful down the road to cache the
  104. answers to popular requests, so we don't have to keep getting
  105. them again.)
  106. 6. Outstanding problems
  107. 1) HTTP proxies already exist. Why waste our time cloning one
  108. badly? When we clone existing stuff, we usually regret it.
  109. 2) It's overbroad. We only seem to need a secure get-a-tor feature,
  110. and instead we're contemplating building a locked-down HTTP proxy.
  111. 3) It's going to add a fair bit of complexity to our code. We do
  112. not currently implement HTTPS. We'd need to refactor lots of the
  113. low-level connection stuff so that "SSL" and "Cell-based" were no
  114. longer synonymous.
  115. 4) It's still unclear how effective this proposal would be in
  116. practice. You need to know that this feature exists, which means
  117. somebody needs to tell you about a bridge (mirror) address and tell
  118. you how to use it. And if they're doing that, they could (e.g.) tell
  119. you about a gmail autoresponder address just as easily, and then you'd
  120. get better authentication of the Tor program to boot.