From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AF3bDelU5V5CagAA0tVLHw (envelope-from ) for ; Sat, 13 Jun 2020 22:36:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SCUqCelU5V6+BAAA1q6Kng (envelope-from ) for ; Sat, 13 Jun 2020 22:36:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BE22E94036C for ; Sat, 13 Jun 2020 22:36:24 +0000 (UTC) Received: from localhost ([::1]:43842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkElD-000099-MU for larch@yhetil.org; Sat, 13 Jun 2020 18:36:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkEkw-000091-St for guix-devel@gnu.org; Sat, 13 Jun 2020 18:36:06 -0400 Received: from mira.cbaines.net ([212.71.252.8]:50690) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkEks-0003Dd-GL for guix-devel@gnu.org; Sat, 13 Jun 2020 18:36:06 -0400 Received: from localhost (unknown [46.237.175.96]) by mira.cbaines.net (Postfix) with ESMTPSA id 886B427BBE1 for ; Sat, 13 Jun 2020 23:36:00 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 6ed43c19 for ; Sat, 13 Jun 2020 22:35:58 +0000 (UTC) User-agent: mu4e 1.2.0; emacs 26.3 From: Christopher Baines To: guix-devel@gnu.org Subject: K of N trust in substitutes (related to reproducible builds) Date: Sat, 13 Jun 2020 23:35:55 +0100 Message-ID: <87lfkq8ugk.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 18:36:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: k9CQB42Vk/Y7 --=-=-= Content-Type: text/plain Hey, So, I've finally got around to actually looking at what code changes might be involved in changing how users of Guix substitutes trust which substitutes to use, and which not to use. This follows on from some of the build reproducibility metrics work that happened recently [1]. 1: https://lists.gnu.org/archive/html/guix-devel/2020-06/msg00034.html The current situation as I understand it is that as a user, you list public keys in your ACL (access control list), and Guix will trust a substitute from a particular cache if it can find a narinfo for that hash with a valid signature, made with a public key listed in the ACL. There's some useful complexity here, because you can end up downloading substitutes from a cache you don't directly trust, but because you trust a different cache that's generated the same substitute (it built reproducibly). As described above, build reproducibility is already making some useful behaviour possible. However, there's no current way of trusting substitutes based on the agreement of multiple substitute servers (caches). Making that possible would allow users to reduce the risk in using substitutes by supporting a more distributed approach to trust. My feeling is that making some initial step forward in this area is going to be tricky, care needs to be taken around the security and backwards compatibility aspects. I've now got around to actually thinking about potential ways to make parts of this happen though, and even changed some code [2] (although I haven't actually tried to run it yet). 2: https://git.cbaines.net/guix/log/?h=k-of-n-substitute-trust&qt=range&q=k-of-n-substitute-trust...master As I understand, the format for the ACL is based around [3] and I was excited to see as part of that specification is something I think might overlap with what I describe wanting above. Specifically, the k-of-n bit. I think this could work something like this in an ACL: (acl (entry (k-of-n 2 3 (public-key (ecc (curve Ed25519) (q #5F5F4F321533D3A38F909785E682798933BA9BE257C97E5ABC07DD08F27B8DBF#) ) ) (public-key (ecc (curve Ed25519) (q #3AF2631C5E78F520CB1DC0D438D8D6F88EEF4B8E11097A62EE2DF390E946AED0#) ) ) (public-key (ecc (curve Ed25519) (q #1EEE5340C3AAD6E062A1395A88A86FC75982E8BC7DCBAE171858EEAAB14AAB77#) ) ) ) (tag (guix import) ) ) ) 3: http://theworld.com/~cme/spki.txt Using the above ACL, you'd trust a substitute for a path with a specific hash if you can find 2 narinfos for that path and hash if they're signed with keys in that entry. Multiple entries would still be supported, and you wouldn't need to specify the k-of-n bit if you don't want to. I'm not quite sure how expressive this is, or if there are some policies that would be good to support that either can't be expressed, or can't be expressed easily. There's probably other approaches, and how to support trusting substitutes is an important part to consider. Let me know if you have any thoughts or questions, Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl7lVMtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdiEw/+IrXP+G6TuEaaFfuCJbkiC6CR6G2f1+8Tk5L4+KirrAiRCQOALb7rAblI lXokF2ruR10nZhbmWIsrUqRPRWo8+KWiIYFRW7mi+Lj6LVuy79I7FArBk6eNqtiC HFbSdEkhBqWlDQ+QbbArINhxZee2vXnkqI7TEURA0fcTLO180lMctADOT3MSErI3 o9Re+ogUWIXS48cirhTS3UZC2pm50vwnS2T9NlEpxSBtzulY6KrOogLUsq3ibxZd xtW7tytGHeATaQhxnanX0j3AYrXFU6sDpDlI2Z9CfQdOXncptN1O+XcG3aOb6LgE 0j0/aQFZ86cGJF+CLKzalpaPopi+3VlaWqVoz/a5C9IJTt7E6Y83pdHMkcCBucP5 apsg7TvjGfsLPKefDwzixmI9ymsk6C6u/w2+y0JwZt3Q3D0+osYwCkUzL6v9kxL2 oM159s4JRERv8ywOVUs4zrIBK+ZLXDLqJI3URHW+PO/WTK+FyGnN0Jh+d8KLVVX6 5lq8baKso99HXOKdUT0YIbFWWv638TtsXGt4Ni4qpg9Xods4NQO92rZhSQEz5ivt 1UvDF1sDSr5l8osPC0kTtg9TjNWVKe5uhrBtC5ShDfo+8xOFrW8HvFXjTYAUZHip UDKnzKJeN4yE7N7C3jfj3uFkJsaTeGwCcukFqtL+yLtnnRSf7XI= =W2U1 -----END PGP SIGNATURE----- --=-=-=--