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