From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +A5oJyXaNWdrjgAA62LTzQ:P1 (envelope-from ) for ; Thu, 14 Nov 2024 11:08:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +A5oJyXaNWdrjgAA62LTzQ (envelope-from ) for ; Thu, 14 Nov 2024 12:08:21 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ojjT+f4V; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=ap3FAQSU; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731582501; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=BoUBnQ7lJVosp43uEj6eQRhTlHcwBhEskBcyMCW2ulQ=; b=RPks65rn/5ozh008/u7mcANJ589HPck0obHbg5+zcS5Gb2Tn8rKlV+o2hmJDhImQbToKli VD83sxo7/EHTVqaEmZ8RjDWpej/UdcpDa/57XPyu99PzjC4jQybWDPCSX+1eguZ1UNcNer 5pAhRoj+mOt+6M0KDfdmMdErGFxmE6CGmV+hI5LzDQu+YG6fqHAZ7+ZLGArPvL/L2MlVng 7XgHX2VGUZRI1x3GoLQNErxT2DS2H+ZUSP4tYyObrTFn7ciLBvwgLBgYVEqEDGzZfhwyVR BjlajKVNHgFf0B4eKJLcJU37TVSjCoJ8xoNs/NtcH1nApJMvtpOyG3QBtrteYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ojjT+f4V; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=ap3FAQSU; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731582501; a=rsa-sha256; cv=none; b=H2ItdIAah+631xBjuQZzsa55KdErytjMdRV7Mp6cEgvW9gSYcO6sAGxKwMxoLyAKF9fH5P 2jDI+Z0qJce/DK5bZOtUMLOmKxv4cgs2R+Af+ZzGPLGgJHvDe0J57BA949UBRou5S+QsNu gPgJkkrSAba1aQtdbrL9RikthYNuO2O0OUiec9zWxjIOaMcCMZkCdOV2+yDTeAmWiMVJMn n7Qty0QiDNv/0KVqbVkiP8HvR1hf1N06stuAhfUp3qzaylXfMAmyBNeIr0PJSEyhpva8Er HiFZ7b4ivABi32xhwFaeyr83voTYnH7G3q9rTo+VN47O4ynmIYTFxqsncJrSZw== 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 9C59A81C81 for ; Thu, 14 Nov 2024 12:08:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBXhl-00065M-4z; Thu, 14 Nov 2024 06:08:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBXhj-000651-70 for bug-guix@gnu.org; Thu, 14 Nov 2024 06:08:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBXhi-0000M8-VF for bug-guix@gnu.org; Thu, 14 Nov 2024 06:08:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=BoUBnQ7lJVosp43uEj6eQRhTlHcwBhEskBcyMCW2ulQ=; b=ojjT+f4VVQxbCx4LMMKV9L6uOWoSYyqhB8k9xNDBAHBbRBXrudPLZ2Ec7AJZHXpeojgO+epGfAknAU1hUSbQRfi+Sgu+9/VmFcI+tVo5dQJ9SKU2DTOMhqtVATD3qXhY+lh3YSyFZOAdo20hQuMY+sBTeq2jZfPn8uY9k63Hu8cmcaGpgrl1469F0d2cMG5Tf0/urZBbZ7jak11Fnsn1l8WDzinrNRHElo7qrJ7C2So8s4kfYv8ugDtv9jyQvflmaP/1OQx9k6p7bo8lpaXhinYm0o6hAEKaqjcINUysqbqRRq8v6m703RtzGLW+kjR73loEcP74ih9K+q7cqrYRzQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBXhi-0000BU-ME for bug-guix@gnu.org; Thu, 14 Nov 2024 06:08:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#73166: shell-autorized-directories Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 14 Nov 2024 11:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73166 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Nicolas Graves Cc: 73166@debbugs.gnu.org, ludo@gnu.org, suhailsingh247@gmail.com, andrew@trop.in X-Debbugs-Original-Cc: 73166@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Saku Laesvuori via Bug reports for GNU Guix , Suhail Singh , Andrew Tropin Received: via spool by submit@debbugs.gnu.org id=B.1731582475694 (code B ref -1); Thu, 14 Nov 2024 11:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Nov 2024 11:07:55 +0000 Received: from localhost ([127.0.0.1]:45242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBXha-0000B8-QO for submit@debbugs.gnu.org; Thu, 14 Nov 2024 06:07:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:53890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBXhZ-0000B0-5h for submit@debbugs.gnu.org; Thu, 14 Nov 2024 06:07:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBXhX-00064Z-49 for bug-guix@gnu.org; Thu, 14 Nov 2024 06:07:51 -0500 Received: from vmi571514.contaboserver.net ([75.119.130.101] helo=mail.laesvuori.fi) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBXhV-0000Kx-4t; Thu, 14 Nov 2024 06:07:50 -0500 Received: from X-kone (87-94-110-203.bb.dnainternet.fi [87.94.110.203]) by mail.laesvuori.fi (Postfix) with ESMTPSA id A69C4340830; Thu, 14 Nov 2024 12:07:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1731582472; bh=H5cqUf1UCgvZcr/uBXoE0wLqWO0A5n3nqJwdkTeDeqE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ap3FAQSUxHdJGE9IvLlUkqucoa89dzh4/pZG+X9CQd4ENMEjtcuf/A0b/DtQ+P6yk g3rX11do4AFkkhlWJUf04R8zxvAKI0hgNlP5U2t8vZNeiVlkFAm4QBefPed+c6D08P 80SsJ475kE4G0OIv52a7ojfnbyIowFElo8owYkPY= Date: Thu, 14 Nov 2024 13:07:36 +0200 Message-ID: References: <87cyla7c0f.fsf@gnu.org> <87mske8emf.fsf@ngraves.fr> <874j4gpkbn.fsf@ngraves.fr> <87bjyn1ga7.fsf@ngraves.fr> <87ikstteal.fsf@gmail.com> <87cyj06g97.fsf@ngraves.fr> <87ttccmrp1.fsf@gmail.com> <87o72k4cty.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c3opbe2lndxy2yqq" Content-Disposition: inline In-Reply-To: <87o72k4cty.fsf@ngraves.fr> Received-SPF: pass client-ip=75.119.130.101; envelope-from=saku@laesvuori.fi; helo=mail.laesvuori.fi X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Saku Laesvuori From: Saku Laesvuori via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -1.51 X-Spam-Score: -1.51 X-Migadu-Queue-Id: 9C59A81C81 X-TUID: inkT6nXRGVwP --c3opbe2lndxy2yqq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 12, 2024 at 05:49:13PM +0100, Nicolas Graves wrote: > On 2024-11-12 09:50, Suhail Singh wrote: >=20 > > I was under the impression that the build phase in guix is always > > containerized and without network access. Could you please elaborate on > > this? >=20 > Building a package yes, but you can have external commands in a > manifest.scm or guix.scm. Saku provided an example in an earlier email > of a valid but dangerous manifest: >=20 > ```scheme > (system* "rm -rf $HOME") > (specifications->manifest (list "hello")) > ``` >=20 > We could also have one that downloads malicious code, or uploads private > info, the POC is left as an an exercice for the reader ;)=20 >=20 > What I was saying is that we could restrain recording `guix shell --allow` > only if the manifest builds properly containerized and without network > access (outside package building I mean), and otherwise refuse to allow > (failing manifest, possibly because it tries to access the network or > files outside the repo) with a warning message, providing the ability to > restrain "automatic loading" to certain "safer" conditions only. >=20 > This would in turn mean that (given the same guix revision) we can > always run a `guix shell --allow`-ed using `guix shell --container` > which actually makes a lot of sense in my use-case. I don't really know > about other use-cases, but I guess it's the same, even a scheme > developper would probably want a manifest that doesn't depend on files > outside of his repo or the network. Saku, do you have an opinion on > this? There are likely some cases where someone would want to define a manifest that depends on external factors, but I do agree they seem rare. Probably not in a public project repo but maybe someone would want to have (for example) different environments in different directories and some common values in ~/.config that all of them refer to. > The downside is that we would have to basically run `guix shell > --container` (and build all there is to build) before being able to run > `guix shell --allow`. In the repository manifest use-case this seems to not be a downside (the user is to build the environment anyway if they authorized it). In other use-cases this might prevent people from using guix shell --allow even though their case might be much more secure (like the environments in different directories sharing common data). > WDYT? The only benefit seems to be in situations where the user would want the shell to be in a container, so maybe in that case the default behaviour should be to also evaluate the manifest in the container. I don't know would that be a good choice. It increases security for those who use a container and don't know that loading an environment is equivalent to executing the file, but if it leads people assume that loading an environment is safer than executing a file in general, they have less security in non-container environments. We should keep in mind that implicit manifests for guix shell are not only useful in public repositories. - Saku --c3opbe2lndxy2yqq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmc12fgACgkQJX0oSiod OjJnpA//bCspwJDxmE8ICVfKEczHwdZqHvK8dq15YZ/tXMcRE34RZhNs6dUuVaIQ fpl/eJNwltEpjD3CtmlPJ996Y0GZgs8dI+MDErc7CBNfROqQIcOrryXeK6XkBKe4 xMKNq5NurJVvTK3ZzOSZpQErY2weivpAcFV53nzqXhXnZHfBJwdCsMq2bwn4FBrG A5PrwlIT7/worAHuRQ6N6UC0gYWBoaS7oT5YW7GabABreItNIrF6wJIfR5Xfi+4p PExQHAUydChMFEKoVHqXHHChPsGokhI1x3Lzs6BAM4s5NXw9r/P+NAxlR3+x3kwh 7HhnU6xr1a/eegPOc9TD1PehqVMAFLdwYh4qOGEEadN2a/NJ1+V0lPxQVVZVnd/p 2VUOB/pIYIlm6jjMi5kewW6IIGJdSt1C3O5PMg/DHI/f1jcaQ0gt0p+MIMHQuuzQ WEfNT2C2Lq2C0y/SgksnU7QiOzczTjaMQgZxwvS3foXzYX9HcapTfsZk7aKHw2Es vt6hfxUUrC3cw+5s8WJ+WTVW9s8B7XaEm3GmUryxhqJhd5HpWfWa10ylKGKGIPGv qPEDGEIFgCqbfP9SHHZFGW6gAM/S6MBS/fPCHP7Ge5YY9i8xi7Ef0Wnjuo8uRt2A axpbnQ7DxLTZUcbp3V6bVeYcK3whwD1sffAhU8zclNk6DQon1/U= =GRhG -----END PGP SIGNATURE----- --c3opbe2lndxy2yqq--