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

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