apt-secure.8.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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-06-09T00: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. several steps. <command>apt-secure</command> is the last step in
  66. this chain; trusting an archive does not mean that you trust its
  67. packages not to contain malicious code, but means that you
  68. trust the archive maintainer. It's the archive maintainer's
  69. responsibility to ensure that the archive's integrity is preserved.
  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. In
  79. order to become effective, this upload needs to be signed by a key
  80. contained in the Debian Maintainers keyring (available in
  81. the debian-keyring package). Maintainers' 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, and checksums of the package
  88. are computed and put in the Packages file. The checksums 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 for this Debian release,
  91. and distributed alongside the packages and the Packages files on
  92. Debian mirrors. The keys are in the Debian archive keyring available in
  93. the <package>debian-archive-keyring</package> package.
  94. </para>
  95. <para>
  96. End users can check the signature of the Release file, extract a checksum
  97. of a package from it and compare it with the checksum of the package
  98. they downloaded by hand - or rely on APT doing this automatically.
  99. </para>
  100. <para>Notice that this is distinct from checking signatures on a
  101. per package basis. It is designed to prevent two possible attacks:
  102. </para>
  103. <itemizedlist>
  104. <listitem><para><literal>Network "man in the middle"
  105. attacks</literal>. Without signature checking, malicious
  106. agents can introduce themselves into the package download process and
  107. provide malicious software either by controlling a network
  108. element (router, switch, etc.) or by redirecting traffic to a
  109. rogue server (through ARP or DNS spoofing
  110. attacks).</para></listitem>
  111. <listitem><para><literal>Mirror network compromise</literal>.
  112. Without signature checking, a malicious agent can compromise a
  113. mirror host and modify the files in it to propagate malicious
  114. software to all users downloading packages from that
  115. host.</para></listitem>
  116. </itemizedlist>
  117. <para>However, it does not defend against a compromise of the
  118. Debian master server itself (which signs the packages) or against a
  119. compromise of the key used to sign the Release files. In any case,
  120. this mechanism can complement a per-package signature.</para>
  121. </refsect1>
  122. <refsect1><title>User configuration</title>
  123. <para>
  124. <command>apt-key</command> is the program that manages the list
  125. of keys used by apt. It can be used to add or remove keys, although
  126. an installation of this release will automatically contain the
  127. default Debian archive signing keys used in the Debian package
  128. repositories.
  129. </para>
  130. <para>
  131. In order to add a new key you need to first download it
  132. (you should make sure you are using a trusted communication channel
  133. when retrieving it), add it with <command>apt-key</command> and
  134. then run <command>apt-get update</command> so that apt can download
  135. and verify the <filename>InRelease</filename> or <filename>Release.gpg</filename>
  136. files from the archives you have configured.
  137. </para>
  138. </refsect1>
  139. <refsect1><title>Archive configuration</title>
  140. <para>
  141. If you want to provide archive signatures in an archive under your
  142. maintenance you have to:
  143. </para>
  144. <itemizedlist>
  145. <listitem><para><emphasis>Create a toplevel Release
  146. file</emphasis>, if it does not exist already. You can do this
  147. by running <command>apt-ftparchive release</command>
  148. (provided in apt-utils).</para></listitem>
  149. <listitem><para><emphasis>Sign it</emphasis>. You can do this by running
  150. <command>gpg --clearsign -o InRelease Release</command> and
  151. <command>gpg -abs -o Release.gpg Release</command>.</para></listitem>
  152. <listitem><para><emphasis>Publish the key fingerprint</emphasis>,
  153. that way your users will know what key they need to import in
  154. order to authenticate the files in the
  155. archive.</para></listitem>
  156. </itemizedlist>
  157. <para>Whenever the contents of the archive change (new packages
  158. are added or removed) the archive maintainer has to follow the
  159. first two steps outlined above.</para>
  160. </refsect1>
  161. <refsect1><title>See Also</title>
  162. <para>
  163. &apt-conf;, &apt-get;, &sources-list;, &apt-key;, &apt-ftparchive;,
  164. &debsign; &debsig-verify;, &gpg;
  165. </para>
  166. <para>For more background information you might want to review the
  167. <ulink
  168. url="http://www.debian.org/doc/manuals/securing-debian-howto/ch7">Debian
  169. Security Infrastructure</ulink> chapter of the Securing Debian Manual
  170. (available also in the harden-doc package) and the
  171. <ulink url="http://www.cryptnet.net/fdp/crypto/strong_distro.html"
  172. >Strong Distribution HOWTO</ulink> by V. Alex Brennen. </para>
  173. </refsect1>
  174. &manbugs;
  175. &manauthor;
  176. <refsect1><title>Manpage Authors</title>
  177. <para>This man-page is based on the work of Javier Fernández-Sanguino
  178. Peña, Isaac Jones, Colin Walters, Florian Weimer and Michael Vogt.
  179. </para>
  180. </refsect1>
  181. </refentry>