apt-secure.8.xml 7.6 KB

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