apt-secure.8.xml 7.7 KB

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