Debian Codegraph @

perl/signing-policy.txt

raw
1 Progeny Package Signing Policy
2
3 John Goerzen <[email protected]>
4
5 Draft 2; February, 2001
6
7 1 Introduction & Background
8
9 One weakness commonly associated with installing software off the
10 Internet – or even a CD-ROM – is verification of authenticity.
11 Can a system administrator really be sure that the packages he
12 thinks he is downloading from a Debian or Progeny mirror are
13 really official packages? Or that a CD-ROM contains the original
14 packages? These days, it is not impossibly difficult to intercept
15 network traffic and insert trojan packages in place of real ones,
16 or to prepare a fake CD-ROM with a realistic-looking label. To
17 thwart this, the ability to add GPG signatures to Debian packages
18 is being implemented. These signatures add a cryptographic
19 guarantee that the package is authentic in a particular way.
20
21 Each package may carry multiple signatures, and each signature
22 may convey unique information. For instance, one signature might
23 confirm that a legitimate Progeny developer uploaded the package;
24 another, that Progeny Quality Assurance has processed the
25 package; and a final one might confirm that a package is part of
26 a particular release.
27
28 On each customer's computer is a file containing rules for
29 authentication of these GPG signatures. The rules file describes
30 which signatures are required, which are optional, and what keys
31 constitute a valid signature for each signature type. Therefore,
32 Progeny can ship rules that might say something like this: “For
33 each package to be installed, require the Progeny corporate
34 signature, a signature from the Quality Assurance team, and
35 either a signature from a Progeny developer that uploaded a
36 Progeny package or an automated signature indicating that the
37 package came from Debian.
38
39 1.1 Goals
40
41 There are several things that we would like to accomplish with
42 this system. Here is a list of many of them, an explanation of
43 how we accomplish it, and why it is valuable.
44
45 1.1.1 Progeny Developer Verification
46
47 The first thing to check on a package is to verify that it was
48 built by an authorized Progeny developer. To this end, we will
49 have a maintainer (“maint”) signature applied to each package at
50 upload time by the person that built it. This key provides
51 several benefits:
52
53 • It provides a guarantee that the package was not modified by
54 anyone else within Progeny. No malicious Progeny employee could
55 modify the package on its way.
56
57 • Customers can know that a package was unmodified from the time
58 it was built.
59
60 Additionally, if Progeny ever discovers that a particular
61 developer was malicious or dangerously incompetent in the
62 building of packages, the packages built by that person can be
63 easily identified and can be rendered uninstallable.
64
65 1.1.2 Quality Assurance Verification
66
67 Another useful point to check on a package is whether or not it
68 has passed through Progeny's Quality Assurance department. By
69 doing so, we can guarantee that no package bypassed the QA
70 department (either by accident or maliciously), and introduce an
71 additional level of verification. By having this second signature
72 present on the package, we reduce the damage done if the key for
73 an individual maintainer were to become compromised in some way.
74 Because we have a maintainer signature already, we have already
75 prevented any malicious QA employee from modifying the package,
76 but if Progeny does at some time find cause to suspect a QA
77 person of handling packages in a dangerous way, the key can be
78 removed and the packages rendered uninstallable in the same
79 manner as with the Debian maintainer signature.
80
81 1.1.3 General Malicious Employee Protection
82
83 Because Progeny's business is so highly dependent upon secure and
84 stable software, if a malicious employee were to be ever hired,
85 serious damage could be done. Package signatures and
86 compartmentalization can be used together to provide an effective
87 weapon to significantly lessen the potential harm that could be
88 caused by such a person. In general, the worst harm that could be
89 inflicted upon Progeny by a malicious employee would be the
90 insertion of trojan or otherwise malicious code into the packages
91 that we distribute to customers and use ourselves. The mechanisms
92 outlined above can help to combat this threat in several ways.
93
94 • A malicious system administrator with full access to the
95 machines on which the archive is served from would ordinarily
96 be able to modify the packages on those machines and insert
97 trojan code virtually undetected. Since the packages had
98 already gone through QA, and probably were already installed on
99 Progeny systems, the change would probably be noticed by
100 customers first. With this system, the maintainer signature is
101 applied before the package is even uploaded to the archive in
102 the first place, so any such change would be immediately
103 noticeable.
104
105 • A malicious developer, often also with full access to the
106 archive, could bypass QA to get malicious code into the
107 archive. With this system, no package would be installable
108 unless it bears a signature from a valid QA employee.
109
110 • A malicious QA employee could modify the package after it has
111 been received from the developers but before it is placed onto
112 the archive. With this proposal, such a change would be
113 immediately noticed because the maintainer signature check
114 would fail.
115
116 1.1.4 General Malicious Outsider Protection
117
118 Another category of problems that we have to worry about concern
119 malicious outsiders. There are several ways that such a person
120 could cause Progeny customers to unknowingly install and run code
121 that poses a security risk to them. We can deal with most of
122 them.
123
124 • Someone could intercept the traffic between a customer's
125 computer and the Progeny archive, inserting data containing
126 trojan code without the customer's knowledge. This is already
127 possible and has been done. By placing signatures on the
128 packages, if they are modified any way during download, the
129 customer would immediately be aware.
130
131 • By “social engineering”, that is, convincing someone through
132 non-technical means to install a package, a malicious person
133 could convince one of our customers to install a package that
134 contains a security problem. However, with signature
135 verification, such a package would fail to install.
136
137 • An outsider could replace the data in a current package with
138 that from a previous version of a package, perhaps one with
139 known security vulnerabilities. With our archive and release
140 signatures, we can dramatically reduce the potential pool of
141 packages from which such a person could draw a signed Progeny
142 package containing a known security problem.
143
144 • A cracker or someone else that gains unauthorized access to
145 Progeny archives could modify the .debs that customers download
146 in-place, giving them code that could pose a security risk.
147 With the mechanisms in this proposal, such a modification would
148 cause multiple signatures to fail, providing an instant way to
149 know that the package had been modified.
150
151 1.2 Unaddressed Issues
152
153 While this proposal can deal with a great many potential problems
154 that could occur, there are still several problems that cannot be
155 dealt with solely within the scope of this system. Here are some
156 of them that we should be aware of.
157
158 • A cracker obtaining root maliciously on a customer's machine
159 could bypass all of the checks that are in place here. Such a
160 person could install fake versions of the verifier that could
161 report false positives. In general, if root is compromised, we
162 can no longer make any assumptions about the security of the
163 customer's machine.
164
165 • A cracker or internal person that has obtained root on a
166 Progeny developer's machine could alter files such that
167 packages built by that developer would contain trojan code that
168 the developer may not be aware of. Hopefully, this would be
169 detected during the QA process, but there is no guarantee of
170 that. Such a cracker could also replace GPG with a program that
171 could surreptitiously gather the developer's secret key and
172 passphrase, causing a compromise of the developer's secret key.
173 Again, once someone has obtained root, we can no longer make
174 any assumptions about the security of the machine.
175
176 • We must have a secure way to get the initial keyring and
177 software to the customer. This is a question of how far we go
178 to make the guarantee. Some options include placing the
179 software behind a HTTPS site that bears a signature from a
180 well-known certifying authority. However, if someone's web
181 browser has already been modified by a malicious person, even
182 this would not guarantee success. Another option is to
183 distribute the initial software and keys via CD-ROM shipped
184 directly from our office, though once again, a malicious person
185 could prepare a fake CD-ROM bearing a realistic-looking label
186 and ship it to a customer. These are questions that we have to
187 deal with outside the framework of the package signing software
188 itself, and basically rely upon striking an acceptable balance
189 between paranoia and ease of use.
190
191 2 Criteria For Verification
192
193 The verification process is that which is performed on a
194 customer's machine when a package is to be installed.
195 Verification software has configurable criteria to indicate what
196 signatures are necessary to consider a package to be valid. While
197 the verification policy is up to each individual system
198 administrator, we must supply a default. A package from Progeny
199 will consider to pass the tests if all of these criteria are met:
200
201 • The package must bear an “origin” signature made by a
202 designated origin key.
203
204 • The package must bear a quality assurance (“qa”) signature made
205 by a member of the Progeny QA team.
206
207 • The package must have a maintainer (“maint”) signature from
208 either:
209
210
211 – A member of the Progeny development team; or
212
213 – An automated signature applied to packages imported
214 unmodified from Debian.
215
216 Possible modifications that we could consider making would be to
217 change some of the logic from “and” to “or”, thus permitting
218 installation even if one signature is missing or somehow invalid.
219 This could make dealing with situations involving lost keys,
220 changing employees, and upgrades easier, but comes at the expense
221 of opening up some potential malicious employee attacks.
222
223 3 Procedures For Signing
224
225 Keys can be added to packages during the development cycle. At
226 each step, we should ensure that all existing keys on the package
227 are valid. The first signature on a package will be added by
228 either the Progeny developer responsible for it or the system
229 that is installing the package from Debian. The next signature
230 will be added by the person in QA that approves the package.
231 After that, the origin signature should be added, and finally,
232 when the package is placed into the archive, an archive signature
233 should be added. All signatures except automated ones are to be
234 made by personal keys. Progeny will maintain keyrings of valid
235 developer and QA keys. Below, the meaning and procedures for each
236 Progeny signature are described.
237
238 3.1 Maintainer Signature
239
240 The maintainer signature is named “maint”. It is to be applied to
241 any package uploaded into the archive by a Progeny developer. The
242 maintainer signature is made with that developer's own GPG key.
243 Its purpose is to let the customer verify that the package was
244 indeed worked on by an authorized Progeny employee.
245
246 Many packages (a majority, in fact) appear in the Progeny
247 distribution directly from Debian with no modification or
248 intervention from Progeny employees. There is no real Progeny
249 developer or uploader in charge of these packages. For these
250 situations, a special key should be generated. A signature from
251 that key should be automatically added to packages that come
252 through from Debian. The username and description for that key
253 should make clear that it does not originate from a particular
254 Progeny developer.
255
256 3.2 Quality Assurance
257
258 As packages move into the distribution, we anticipate that they
259 will be screened by QA. To that end, a “qa” signature will be
260 made for the package. It will be made using the GPG key of the
261 specific QA employee that approves the package. Any package
262 bearing a valid QA signature can thus be assumed to have passed
263 their testing for the distribution. There should be no case in
264 which this key is added automatically. An exception may need to
265 be made for initial bootstrapping; that is, dealing with the
266 thousands of packages already in the distribution prior to QA
267 procedures.
268
269 3.3 Origin
270
271 The only key that must be present in the debsigs system is “
272 origin”. This key certifies the originator of the package (in
273 this case, Progeny Linux Systems) and lets the signature verifier
274 load the appropriate ruleset for the verification of signatures.
275 This key will probably be added automatically, using our
276 corporate key or some designated origin key that bears its
277 signature.
278
279 4 Safeguarding Keys
280
281 The task of safeguarding individual keys is already well-known,
282 understood, and easily manageable. However, safeguarding keys
283 that are used by many people or to apply automated signatures
284 gets more difficult. In some cases, the security of these is not
285 as important – for instance, an archive key will not inflict much
286 damange if compromised. However, in other cases, the security is
287 still quite important.
288
289 Safeguarding of individual keys is a well-known problem with
290 well-documented answers. To provide a comprehensive system, there
291 are also other cases that we need to consider, which are spelled
292 out below.
293
294 5 Special Cases & Procedures
295
296 While the policy laid out here will work smoothly for day-to-day
297 operation, things can go wrong or get confused and planning for
298 them is a must. In this section, I describe some special cases
299 that can face us, what they mean for the package signing system,
300 and how we can prepare for them ahead of time and deal with them
301 when they occur.
302
303 5.1 Employee Leaves
304
305 If a Progeny employee leaves the company for some reason, and
306 this person was someone whose key was used to create signatures
307 for packages that are used by customers, then Progeny will need
308 to decide, on a case-by-case basis, several things:
309
310 • Do we have any reason to believe that the packages in the
311 archive now bearing this person's signature are in any way
312 damaged or tampered with?
313
314 • Do we have any reason to believe that this person may, in the
315 future, intend to inflict harm on Progeny through the use of
316 the key used to apply those signatures?
317
318 If the answer to the first question is “yes”, then we would
319 immediately need to remove the key of this employee from all
320 keyrings and rebuild the effected packages. If the answer to the
321 second question is “yes”, then we would need to immediately
322 remove this person's key from all internal keyrings (such that
323 the maintainer signature check made by QA would fail if somehow
324 the person uploads a package after leaving the company), but
325 removing the key from the external keyrings is not a priority and
326 can be done at a more leisurely pace. If both answers are “no”,
327 then Progeny should, as a precaution, rebuild packages signed by
328 that user eventually, but there is no need to do so before the
329 next release.
330
331 5.2 People Join Progeny
332
333 When a new person is hired for a development or QA position, this
334 person will need to generate a personal key and have it inserted
335 onto the keyring. Customers will not be able to verify a
336 signature made by this new person until they have upgraded their
337 Progeny keyring package. Once that is done, packages will be able
338 to verify with no difficulty. We may need to ensure that the new
339 keyring package gets installed early in any upgrade procedure,
340 but beyond that, there is little that we must do specially in
341 this case. Note, though, that an existing employee must be the
342 one to sign the new keyring package.
343
344 5.3 Many Employees Leave
345
346 In the event that enough employees from a particular department
347 leave the company such that there no longer exists anyone with a
348 key that can make a valid signature for a particular category, we
349 need to have a way to allow customers to continue receiving
350 updates in a secure fashion. For this purpose, I suggest that
351 Progeny create a generic key for both the QA and maintainer
352 categories, store it in some physically secure area (such as a
353 safe or deposit box) on removable media in a fashion that only
354 authorized company officers could get the key in an emergency.
355 The public key would be inserted on the distributed keyring
356 files, but would never be used unless absolutely necessary.
357
358 5.4 Key Compromises
359
360 If a key becomes compromised (that is, an intruder obtains the
361 secret key and passphrase, enabling unauthorized signatures),
362 then we must take steps to rectify the problem immediately.
363 Depending on the type of key that was compromised and the
364 circumstances, we might opt to immediately remove the compromised
365 key from all keyrings and rebuild any effected packages. In all
366 cases, the victim of the compromise should issue a revocation
367 certificate, discard the old key, and generate a new one for
368 future use.
369
370 5.5 Compartmentalization
371
372 One of the benefits of having multiple signatures on a package is
373 to reduce the damage that can be inflicted if one of those keys
374 becomes untrusted in some fashion. For this reason, we should
375 make sure that we do not have overlap between those that make
376 signatures for different parts of the operation. Specifically,
377 nobody should be both on the maintainer and the QA keyring.
378
379 6 Future Options
380
381 In the course of preparing this policy, some ideas were discussed
382 but discarded for the moment. This section will explain them as
383 possible options for future use.
384
385 6.1 Goal: Release & Dating of Packages
386
387 One potential problem that could arise for a customer is that a
388 malicious person could present an old package as if it were
389 current. If this old package contains problems, such as known
390 security vulnerabilities, doing so could be an avenue for attack.
391 Preventing this problem entirely is not really feasible; however,
392 we can significantly lessen the potential vulnerability by
393 providing a limited “window” of time for which we consider a
394 particular package valid.
395
396 For this situation, we must consider CD-ROM and online
397 distribution separately. For online distribution, we can apply an
398 “archive” signature, automatically, to each package in the
399 archive. Because all signatures contain a timestamp indicating
400 when they were made, the signature verifier on the customer's
401 machine can ensure that the signature was placed on the package
402 within a certain timeframe – for example, two weeks. On our side,
403 we would automatically re-sign all packages with the archive key
404 periodically – in this example, perhaps once a week. In this way,
405 a customer installing a package knows that it is no more than two
406 weeks out of date. Packages distributed via CD-ROM will either
407 not have the archive signature or will have it ignored.
408
409 This solution won't work for a CD-ROM because they are frequently
410 used more than two weeks from the release and because there is no
411 way to propagate signature updates to people using them.
412 Therefore, the best we can do is guarantee the customer that a
413 given package is indeed part of the release that is expected –
414 that is, if Progeny 2.1 is current, that a given package was
415 released as part of Progeny 2.1 and does not date back to version
416 1.1. Another benefit of the release signature is that it can be
417 virtually uncompromisable. The release signature can be applied
418 to the packages at release time, and then the key behind it can
419 be destroyed. However, as a practical matter, we will need to
420 publish at least one future release key in the current keyring so
421 that people upgrading will be able to do so in a secure fashion.
422
423 6.1.1 Archive
424
425 The “archive” signature is to be automatically applied by
426 dinstall when a package is installed into Progeny's
427 publically-accessible archive, regardless of the particular area
428 that it is installed into. A valid signature can be used to
429 assure that a package was indeed posted by Progeny on a specific
430 date.
431
432 6.1.2 Release
433
434 The release key should be kept in a secure, safe place accessible
435 only by authorized company officers prior to use. After it has
436 been used, it should be permanently destroyed. Release keys will
437 need to be generated at least one release ahead of use to provide
438 a suitable upgrade path for users.
439