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