apt-secure.8.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY % aptent SYSTEM "apt.ent">
  5. %aptent;
  6. ]>
  7. <refentry>
  8. &apt-docinfo;
  9. <refmeta>
  10. <refentrytitle>apt-secure</refentrytitle>
  11. <manvolnum>8</manvolnum>
  12. </refmeta>
  13. <!-- NOTE: This manpage has been written based on the
  14. Securing Debian Manual ("Debian Security
  15. Infrastructure" chapter) and on documentation
  16. available at the following sites:
  17. http://wiki.debian.net/?apt06
  18. http://www.syntaxpolice.org/apt-secure/
  19. http://www.enyo.de/fw/software/apt-secure/
  20. -->
  21. <!-- TODO: write a more verbose example of how it works with
  22. a sample similar to
  23. http://www.debian-administration.org/articles/174
  24. ?
  25. -->
  26. <!-- Man page title -->
  27. <refnamediv>
  28. <refname>apt-secure</refname>
  29. <refpurpose>Archive authentication support for APT</refpurpose>
  30. </refnamediv>
  31. <refsect1><title>Description</title>
  32. <para>
  33. Starting with version 0.6, <command>apt</command> contains code
  34. that does signature checking of the Release file for all
  35. archives. This ensures that packages in the archive can't be
  36. modified by people who have no access to the Release file signing
  37. key.
  38. </para>
  39. <para>
  40. If a package comes from a archive without a signature or with a
  41. signature that apt does not have a key for that package is
  42. considered untrusted and installing it will result in a big
  43. warning. <command>apt-get</command> will currently only warn
  44. for unsigned archives, future releases might force all sources
  45. to be verified before downloading packages from them.
  46. </para>
  47. <para>
  48. The package frontends &apt-get;, &aptitude; and &synaptic; support this new
  49. authentication feature.
  50. </para>
  51. </refsect1>
  52. <refsect1><title>Trusted archives</title>
  53. <para>
  54. The chain of trust from an apt archive to the end user is made up of
  55. different steps. <command>apt-secure</command> is the last step in
  56. this chain, trusting an archive does not mean that the packages
  57. that you trust it do not contain malicious code but means that you
  58. trust the archive maintainer. Its the archive maintainer
  59. responsibility to ensure that the archive integrity is correct.
  60. </para>
  61. <para>apt-secure does not review signatures at a
  62. package level. If you require tools to do this you should look at
  63. <command>debsig-verify</command> and
  64. <command>debsign</command> (provided in the debsig-verify and
  65. devscripts packages respectively).</para>
  66. <para>
  67. The chain of trust in Debian starts when a maintainer uploads a new
  68. package or a new version of a package to the Debian archive. This
  69. upload in order to become effective needs to be signed by a key of
  70. a maintainer within the Debian maintainer's keyring (available in
  71. the debian-keyring package). Maintainer's keys are signed by
  72. other maintainers following pre-established procedures to
  73. ensure the identity of the key holder.
  74. </para>
  75. <para>
  76. Once the uploaded package is verified and included in the archive,
  77. the maintainer signature is stripped off, an MD5 sum of the package
  78. is computed and put in the Packages file. The MD5 sum of all of the
  79. packages files are then computed and put into the Release file. The
  80. Release file is then signed by the archive key (which is created
  81. once a year and distributed through the FTP server. This key is
  82. also on the Debian keyring.
  83. </para>
  84. <para>
  85. Any end user can check the signature of the Release file, extract the MD5
  86. sum of a package from it and compare it with the MD5 sum of the
  87. package he downloaded. Prior to version 0.6 only the MD5 sum of the
  88. downloaded Debian package was checked. Now both the MD5 sum and the
  89. signature of the Release file are checked.
  90. </para>
  91. <para>Notice that this is distinct from checking signatures on a
  92. per package basis. It is designed to prevent two possible attacks:
  93. </para>
  94. <itemizedlist>
  95. <listitem><para><literal>Network "man in the middle"
  96. attacks</literal>. Without signature checking, a malicious
  97. agent can introduce himself in the package download process and
  98. provide malicious software either by controlling a network
  99. element (router, switch, etc.) or by redirecting traffic to a
  100. rogue server (through arp or DNS spoofing
  101. attacks).</para></listitem>
  102. <listitem><para><literal>Mirror network compromise</literal>.
  103. Without signature checking, a malicious agent can compromise a
  104. mirror host and modify the files in it to propage malicious
  105. software to all users downloading packages from that
  106. host.</para></listitem>
  107. </itemizedlist>
  108. <para>However, it does not defend against a compromise of the
  109. Debian master server itself (which signs the packages) or against a
  110. compromise of the key used to sign the Release files. In any case,
  111. this mechanism can complement a per-package signature.</para>
  112. </refsect1>
  113. <refsect1><title>User configuration</title>
  114. <para>
  115. <command>apt-key</command> is the program that manages the list
  116. of keys used by apt. It can be used to add or remove keys although
  117. an installation of this release will automatically provide the
  118. default Debian archive signing keys used in the Debian package
  119. repositories.
  120. </para>
  121. <para>
  122. In order to add a new key you need to first download it
  123. (you should make sure you are using a trusted communication channel
  124. when retrieving it), add it with <command>apt-key</command> and
  125. then run <command>apt-get update</command> so that apt can download
  126. and verify the <filename>Release.gpg</filename> files from the archives you
  127. have configured.
  128. </para>
  129. </refsect1>
  130. <refsect1><title>Archive configuration</title>
  131. <para>
  132. If you want to provide archive signatures in an archive under your
  133. maintenance you have to:
  134. </para>
  135. <itemizedlist>
  136. <listitem><para><literal>Create a toplevel Release
  137. file</literal>. if it does not exist already. You can do this
  138. by running <command>apt-ftparchive release</command>
  139. (provided inftp apt-utils).</para></listitem>
  140. <listitem><para><literal>Sign it</literal>. You can do this by running
  141. <command>gpg -abs -o Release.gpg Release</command>.</para></listitem>
  142. <listitem><para><literal>Publish the key fingerprint</literal>,
  143. that way your users will know what key they need to import in
  144. order to authenticate the files in the
  145. archive.</para></listitem>
  146. </itemizedlist>
  147. <para>Whenever the contents of the archive changes (new packages
  148. are added or removed) the archive maintainer has to follow the
  149. first two steps previously outlined.</para>
  150. </refsect1>
  151. <refsect1><title>See Also</title>
  152. <para>
  153. &apt-conf;, &apt-get;, &sources-list;, &apt-key;, &apt-archive;,
  154. &debsign; &debsig-verify;, &gpg;
  155. </para>
  156. <para>For more backgound information you might want to review the
  157. <ulink
  158. url="http://www.debian.org/doc/manuals/securing-debian-howto/ch7.en.html">Debian
  159. Security Infrastructure</ulink> chapter of the Securing Debian Manual
  160. (available also in the harden-doc package) and the
  161. <ulink url="http://www.cryptnet.net/fdp/crypto/strong_distro.html"
  162. >Strong Distribution HOWTO</ulink> by V. Alex Brennen. </para>
  163. </refsect1>
  164. &manbugs;
  165. &manauthor;
  166. <refsect1><title>Manpage Authors</title>
  167. <para>This man-page is based on the work of Javier Fernández-Sanguino
  168. Peña, Isaac Jones, Colin Walters, Florian Weimer and Michael Vogt.
  169. </para>
  170. </refsect1>
  171. </refentry>