torbl-design.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Design For A Tor RBL {DRAFT}
  2. Status:
  3. This is a suggested design for a DNSBL for Tor exit nodes. It hasn't been
  4. implemented.
  5. Why?
  6. It's useful for third parties to be able to tell when they've got a
  7. connection from a Tor exit node. Potential aplications range from
  8. "anonymous user" cloaks on IRC networks like oftc, to networks like
  9. Freenode that apply special authentication rules to users from these
  10. IPs, to systems like Wikipedia that want to make a priority of
  11. _unblocking_ shared IPs more liberally than non-shared IPs, since shared
  12. IPs presumably have non-abusive users as well as abusive ones.
  13. Since Tor provides exit policies, not every Tor server will connect to
  14. every address:port combination on the Internet. Unless you're trying to
  15. penalize hosts for supporting anonymity, it makes more sense to answer
  16. the fine-grained question "which Tor servers will connect to _me_" than
  17. the coarse-grained question "which Tor servers exist?" The fine-grained
  18. approach also helps Tor server ops who share an IP with their Tor
  19. server: if they want to access a site that blocks Tor users, they can
  20. add that site to their exit policy, and the site can learn that they
  21. won't send it anonymous connections.
  22. Tor already ships with a tool (the "exitlist" script) to identify which
  23. Tor nodes might open anonymous connections to any given exit address.
  24. But this is a bit tricky to set up, and isn't seeing much use.
  25. Conversely, providers of some DNSBL implementations are providing
  26. coarse-grained lists of Tor hosts -- sometimes even listing servers that
  27. permit no exit connections at all. This is rather a problem, since
  28. support for DNSBL is pretty ubiquitous.
  29. How?
  30. Keep a running Tor instance, and parse the cached-routers and
  31. cached-routers.new files as new routers arrive. To tell whether a given
  32. server allows connections to a certain address:port combo, look at the
  33. definitions in dir-spec.txt or follow the logic of the current exitlist
  34. script.
  35. FetchUselessDescriptors would probably be a good option to enable.
  36. If you're also running a directory cache, you get extra-fresh
  37. information.
  38. The DNS interface
  39. DNSBL, if I understand right, looks like this: There's some host at
  40. foo.example.com. You want to know if 1.2.3.4 is in the list, so you
  41. query for an A record for 4.3.2.1.foo.example.com. If the record
  42. exists, 1.2.3.4 is in the list. If you get an NXDOMAIN error, 1.2.3.4
  43. is not in the list.
  44. Assume that the DNSBL sits at some host, torhosts.example.com. Below
  45. are some queries that could be supported, though some of them are
  46. possibly a bad idea.
  47. "General IP:Port"
  48. Format:
  49. {IP1}.{port}.{IP2}.ip-port.torhosts.example.com
  50. Rule:
  51. Iff {IP1} is a Tor server that permits connections to {port} on
  52. {IP2}, then there should be an A record.
  53. Example:
  54. "1.0.0.10.80.4.3.2.1.ip-port.torhosts.example.com" should exist
  55. if and only if there is a Tor server at 10.0.0.1 that allows
  56. connections to port 80 on 1.2.3.4.
  57. Example use:
  58. I'm running an IRC server at w.x.y.z:9999, and I want to tell
  59. whether an incoming connections are from Tor servers. I set
  60. up my IRC server to give a special mask to any user coming from
  61. an IP listed in 9999.z.y.x.w.ip-port.torhosts.example.com.
  62. Later, when I get a connection from a.b.c.d, my ircd looks up
  63. "d.c.b.a.9999.z.y.x.w.ip-port.torhosts.example.com" to see
  64. if it's a Tor server that allows connections to my ircd.
  65. "IP-port group."
  66. Format:
  67. {IP}.{listname}.list.torhosts.example.com
  68. Rule:
  69. Iff this Tor server is configured with an IP:Port list named
  70. {listname}, and {IP} is a Tor server that permits connections to
  71. any member of {listname}, then there exists an A record.
  72. Example:
  73. Suppose torhosts.example.com has a list of IP:Port called "foo".
  74. There is an A record for 4.3.2.1.foo.list.torhosts.example.com
  75. if and only if 1.2.3.4 is a Tor server that permits connections
  76. to one of the addresses in list "foo|.
  77. Example use:
  78. Suppose torhosts.example.com has a list of hosts in "examplenet",
  79. a popular IRC network. Rather than having them each set up to
  80. query the appropriate "ip-port" list, they could instead all be
  81. set to query a central examplenet.list.torhosts.example.com.
  82. Problems:
  83. We'd be better off if each individual server queried about hosts
  84. that allowed connections to itself. That way, if I wanted to
  85. allow anonymous connections to foonet, but I wanted to be able to
  86. connect to foonet from my own IP without being marked, I could add
  87. just a few foonet addresses to my exit policy.
  88. "My IP, with port."
  89. Format:
  90. {IP}.{port}.me.torhosts.example.com
  91. Rule:
  92. An A record exists iff there is a tor server at {IP} that permits
  93. connections to {port} on the host that requested the lookup.
  94. Example:
  95. "4.3.2.1.80.me.torhosts.example.com" should have an A record if
  96. and only if there is a Tor server at 1.2.3.4 that allows
  97. connections to port 80 of the querying host.
  98. Example use:
  99. Somebody wants to set up a quick-and-dirty Tor detector for a
  100. single webserver: just point them at 80.me.torhosts.example.com.
  101. Problem:
  102. This would be easiest to use, but DNS gets in the way. If you
  103. create DNS records that give different results depending on who is
  104. asking, you mess up caching. There could be a fix here, but might
  105. now.
  106. here.
  107. RECOMMENDATION: Just build ip-port for now, and see what demand is
  108. like. There's no point in building mechanisms nobody wants.
  109. Web interface:
  110. Should provide the same data as the dns interface.
  111. Other issues:
  112. 30-60 minutes is not an unreasonable TTL.
  113. There could be some demand for address masks and port lists. Address
  114. masks wider than /8 make me nervous here, as do port ranges.
  115. We need an answer for what to do about hosts which exit from different
  116. IPs than their advertised IP.