apt-secure.8.xml 7.9 KB

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