153-automatic-software-update-protocol.txt 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. Filename: 153-automatic-software-update-protocol.txt
  2. Title: Automatic software update protocol
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Jacob Appelbaum
  6. Created: 14-July-2008
  7. Status: Superseded
  8. [Superseded by thandy-spec.txt]
  9. Automatic Software Update Protocol Proposal
  10. 0.0 Introduction
  11. The Tor project and its users require a robust method to update shipped
  12. software bundles. The software bundles often includes Vidalia, Privoxy, Polipo,
  13. Torbutton and of course Tor itself. It is not inconcievable that an update
  14. could include all of the Tor Browser Bundle. It seems reasonable to make this
  15. a standalone program that can be called in shell scripts, cronjobs or by
  16. various Tor controllers.
  17. 0.1 Minimal Tasks To Implement Automatic Updating
  18. At the most minimal, an update must be able to do the following:
  19. 0 - Detect the curent Tor version, note the working status of Tor.
  20. 1 - Detect the latest Tor version.
  21. 2 - Fetch the latest version in the form of a platform specific package(s).
  22. 3 - Verify the itegrity of the downloaded package(s).
  23. 4 - Install the verified package(s).
  24. 5 - Test that the new package(s) works properly.
  25. 0.2 Specific Enumeration Of Minimal Tasks
  26. To implement requirement 0, we need to detect the current Tor version of both
  27. the updater and the current running Tor. The update program itself should be
  28. versioned internally. This requirement should also test connecting through Tor
  29. itself and note if such connections are possible.
  30. To implement requirement 1, we need to learn the concensus from the directory
  31. authorities or fail back to a known good URL with cryptographically signed
  32. content.
  33. To implement requirement 2, we need to download Tor - hopefully over Tor.
  34. To implement requirement 3, we need to verify the package signature.
  35. To implement requirement 4, we need to use a platform specific method of
  36. installation. The Tor controller performing the update perform these platform
  37. specific methods.
  38. To implement requirement 5, we need to be able to extend circuits and reach
  39. the internet through Tor.
  40. 0.x Implementation Goals
  41. The update system will be cross platform and rely on as little external code
  42. as possible. If the update system uses it, it must be updated by the update
  43. system itself. It will consist only of free software and will not rely on any
  44. non-free components until the actual installation phase. If a package manager
  45. is in use, it will be platform specific and thus only invoked by the update
  46. system implementing the update protocol.
  47. The update system itself will attempt to perform update related network
  48. activity over Tor. Possibly it will attempt to use a hidden service first.
  49. It will attempt to use novel and not so novel caching
  50. when possible, it will always verify cryptographic signatures before any
  51. remotely fetched code is executed. In the event of an unusable Tor system,
  52. it will be able to attempt to fetch updates without Tor. This should be user
  53. configurable, some users will be unwilling to update without the protection of
  54. using Tor - others will simply be unable because of blocking of the main Tor
  55. website.
  56. The update system will track current version numbers of Tor and supporting
  57. software. The update system will also track known working versions to assist
  58. with automatic The update system itself will be a standalone library. It will be
  59. strongly versioned internally to match the Tor bundle it was shiped with. The
  60. update system will keep track of the given platform, cpu architecture, lsb_release,
  61. package management functionality and any other platform specific metadata.
  62. We have referenced two popular automatic update systems, though neither fit
  63. our needs, both are useful as an idea of what others are doing in the same
  64. area.
  65. The first is sparkle[0] but it is sadly only available for Cocoa
  66. environments and is written in Objective C. This doesn't meet our requirements
  67. because it is directly tied into the private Apple framework.
  68. The second is the Mozilla Automatic Update System[1]. It is possibly useful
  69. as an idea of how other free software projects automatically update. It is
  70. however not useful in its currently documented form.
  71. [0] http://sparkle.andymatuschak.org/documentation/
  72. [1] http://wiki.mozilla.org/AUS:Manual
  73. 0.x Previous methods of Tor and related software update
  74. Previously, Tor users updated their Tor related software by hand. There has
  75. been no fully automatic method for any user to update. In addition, there
  76. hasn't been any specific way to find out the most current stable version of Tor
  77. or related software as voted on by the directory authority concensus.
  78. 0.x Changes to the directory specification
  79. We will want to supplement client-versions and server-versions in the
  80. concensus voting with another version identifier known as
  81. 'auto-update-versions'. This will keep track of the current concensus of
  82. specific versions that are best per platform and per architecture. It should
  83. be noted that while the Mac OS X universal binary may be the best for x86
  84. processers with Tiger, it may not be the best for PPC users on Panther. This
  85. goes for all of the package updates. We want to prevent updates that cause Tor
  86. to break even if the updating program can recover gracefully.
  87. x.x Assumptions About Operating System Package Management
  88. It is assumed that users will use their package manager unless they are on
  89. Microsoft Windows (any version) or Mac OS X (any version). Microsoft Windows
  90. users will have integration with the normal "add/remove program" functionality
  91. that said users would expect.
  92. x.x Package Update System Failure Modes
  93. The package update will try to ensure that a user always has a working Tor at
  94. the very least. It will keep state to remember versions of Tor that were able
  95. to bootstrap properly and reach the rest of the Tor network. It will also keep
  96. note of which versions broke. It will select the best Tor that works for the
  97. user. It will also allow for anonymized bug reporting on the packages
  98. available and tested by the auto-update system.
  99. x.x Package Signature Verification
  100. The update system will be aware of replay attacks against the update signature
  101. system itself. It will not allow package update signatures that are radically
  102. out of date. It will be a multi-key system to prevent any single party from
  103. forging an update. The key will be updated regularly. This is like authority
  104. key (see proposal 103) usage.
  105. x.x Package Caching
  106. The update system will iterate over different update methods. Whichever method
  107. is picked will have caching functionality. Each Tor server itself should be
  108. able to serve cached update files. This will be an option that friendly server
  109. administrators can turn on should they wish to support caching. In addition,
  110. it is possible to cache the full contents of a package in an
  111. authoratative DNS zone. Users can then query the DNS zone for their package.
  112. If we wish to further distribute the update load, we can also offer packages
  113. with encrypted bittorrent. Clients who wish to share the updates but do not
  114. wish to be a server can help distribute Tor updates. This can be tied together
  115. with the DNS caching[2][3] if needed.
  116. [2] http://www.netrogenic.com/dnstorrent/
  117. [3] http://www.doxpara.com/ozymandns_src_0.1.tgz
  118. x.x Helping Our Users Spread Tor
  119. There should be a way for a user to participate in the packaging caching as
  120. described in section x.x. This option should be presented by the Tor
  121. controller.
  122. x.x Simple HTTP Proxy To The Tor Project Website
  123. It has been suggested that we should provide a simple proxy that allows a user
  124. to visit the main Tor website to download packages. This was part of a
  125. previous proposal and has not been closely examined.
  126. x.x Package Installation
  127. Platform specific methods for proper package installation will be left to the
  128. controller that is calling for an update. Each platform is different, the
  129. installation options and user interface will be specific to the controller in
  130. question.
  131. x.x Other Things
  132. Other things should be added to this proposal. What are they?