apt-secure.8.xml 7.9 KB

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