[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Securing the software distribution chain

From: Ludovic Courtès
Subject: Re: Securing the software distribution chain
Date: Mon, 27 Jul 2020 14:53:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Justus!

Justus Winter <> skribis:

>> Before submitting a patch that adds or modifies a package definition,
>> please run through this check list:
>> 1. If the authors of the packaged software provide a cryptographic
>>    signature for the release tarball, make an effort to verify the
>>    authenticity of the archive. For a detached GPG signature file this
>>    would be done with the gpg --verify command.
> For me, this is a tooling problem.  'guix download' should authenticate
> the downloaded artifact before it computes and prints the hashsum.
> There are two problems to solve: It needs to locate the signature, and
> it has to know the set of cryptographic identities eligible to create
> the signature.

Note that ‘guix refresh -u’ and ‘guix import gnu’ (and maybe other
importers too?) take care of tarball authentication already.  ‘guix
download’ could share part of the mechanism.  I agree it would be nice.

> For some transports, like git, locating the signatures is not a problem,
> but for http, there is just no standard on where the detatched signature
> is located, or even what data it is computed over (for example,
> signs the uncompressed tarball).

Yes, (guix upstream), which is what ‘guix refresh -u’ uses, takes care
of the “special case”.

> So I think two things need to happen before this step can be improved:
> The package metadata should include the URL of the signature and a set
> of cryptographic identities eligible for signing the artifact.

The idea of storing cryptographic metadata directly in <origin> has been
discussed a few times:

To me, the biggest shortcoming of this approach is if this metadata is
primarily “ornamental”: if in practice, ‘guix build -S’ doesn’t use it
(and it has no reason to use it), then that metadata is likely to become
stale without anyone noticing.

Of course we could have additional tools to make use of that info, say
‘guix build -S --authenticate’ or something.  But that would still be

> Thinking a bit more about having a hashsum as part of the packaging
> definition, it seems to me that this is a bit of a modelling error.
> Because there is no standardized way of authenticating a source
> distribution, Guix defers this step to the packager.  And if there is no
> way to authenticate an artifact (because upstream doesn't provide
> signatures), we at least get TOFU, i.e. the assurance that any user
> gets the same artifact as the packager.
> This doesn't seem terribly problematic, but it doesn't support parts of
> the artifact changing, because in this model, this cannot be
> distinguished from an attack.  Is there a way an artifact may change in
> a valid way that Guix (and other distributions) may want to support?

What do you mean?  If, for example, a tarball is modified in-place
upstream, it’s an error from Guix’ viewpoint.

> We believe there is.  We propose to solve the problem of locating the
> signatures by bundling them with the source distribution.  Instead of
> using a detached PGP signature, we want to distribute the source as a
> signed PGP message.
> Now, if you compute a hashsum over such an artifact, you are in effect
> notarizing the signatures in the message and the message payload.  If
> the developers add a signature to the message, the hashsum changes and
> your notarization breaks.
> The preferred way to support this is to not verify that the hashsum over
> the artifact matches, but to verify the PGP signatures over the payload
> using the set of eligible signing keys in the package metadata.

In practice, we don’t get to choose the authentication method.  You’re
proposing a different authentication method here, but we’re just
downstream: you’ll have to convince upstreams first.  :-)

On a related note, and perhaps that’s what you mean by “parts of the
artifact changing”, see the discussion on authenticating source code
archived at Software Heritage:

Content-addressing is nice, but not very useful if each tool (IPFS, SWH,
Git, Guix) has its own way to address content…



reply via email to

[Prev in Thread] Current Thread [Next in Thread]