apt-secure.8.xml 7.9 KB

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