summaryrefslogtreecommitdiffstats
path: root/dev/archive/signing.mdwn
blob: ac512b9adce772bc7280cb89273d8ec22d719c94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[[!meta title="Package Archive Signing"]]

Background
==========

Package archive signing will enable verification of package archive index files
and establish a chain of trust (through `SHA256sum` fields) to verify individual
packages.  It will allow ProteanOS's package management tools to more securely
retrieve packages from the archive.

Implementation
==============

ProteanOS Archive Manager
-------------------------

[[pro-archman|dev/pro-archman]] will gain a new option: an archive signing key.
If a key is provided, pro-archman will run `gpg` to sign, with the specified
key, `Packages` feed index files when generated.

A `gpg` executable will be an optional dependency, found by the `configure`
script at build time.

ProteanOS Development Kit
-------------------------

[[prokit|dev/prokit]] will verify package feed index files with `gpg` if
configured in the profile, and the `proteanos` profile will enable such
verification.

A `gpg` executable will be an optional dependency, found by the `configure`
script at build time.

A keyring (or ASCII-armored keys that are added to a keyring at either build
time or run time) associated with the profile should probably be included with
prokit.  Otherwise, a user would need to manually import the archive signing
key(s) into their keyring.

If keys are distributed with prokit, **revocations and key transitions need to
be handled somehow**.

New keys can be distributed with new versions of prokit, though this would
require users to upgrade prokit to get new keys.  Revocations, being more of a
security risk that can go unnoticed by users, would need to be more actively and
immediately received by users.  prokit could perhaps check a key server (over
HKPS) each time before using a key.

And if prokit needs to check key servers anyway, it could also use them to find
new archive signing keys, as long as at least one "seed" key is distributed with
prokit.  prokit should find and use only archive signing keys (by a user ID
specified in the profile) that are signed by a non-revoked previous key (or a
signed chain of keys with the user ID).

A user already has to import a key into their own keyring to verify their prokit
download.  Maybe it's better to just instruct users to also download the archive
signing key(s) into their keyrings.  This takes advantage of existing PKI, and
leaves users to make sure their keyring is kept updated with signatures,
revocations, changed expiration dates, and transitions.  It also avoids having
released prokit versions "expire" due to included keys expiring.

Suggestions welcome.

Opkg
----

The opkg package manager supports verifying package feeds.  This feature
requires linking against the [GnuPG Made Easy (GPGME) library][gpgme].

GPGME and its dependencies are now packaged in ProteanOS, so opkg can be built
with package feed verification.  This feature should be optional.  The `opkg`
source package should have two builds, with and without verification enabled.
This will probably mean generating new binary packages `opkg-gpg` and
`libopkg.1-gpg` (which will conflict with `opkg` and `libopkg.1` respectively)
and installing data files into binary package directories without the aid of
`oh-installfiles`.  Although, option 1 of the [[static_libopkg|pkg/opkg/static]]
plan would simplify this by getting rid of the `libopkg.1` and `libopkg.1-dev`
packages altogether.  The `opkg` source package could then build just `opkg`,
`opkg-gpg`, `opkg-dbg`, and `opkg-doc` binary packages.

Archive Keyring
---------------

The package archive keyring will need to be maintained in a ProteanOS package.
Key transitions, expiration changes, and revocations will be performed by
revisions to this package.  It should possibly be upgraded automatically to
ensure that installed systems always have up-to-date keys.

[gpgme]: https://www.gnupg.org/software/gpgme/index.html