From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mMOoNy4oWV/LTwAA0tVLHw (envelope-from ) for ; Wed, 09 Sep 2020 19:08:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id IBSiMy4oWV85GQAAB5/wlQ (envelope-from ) for ; Wed, 09 Sep 2020 19:08:30 +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 7B06E9404CF for ; Wed, 9 Sep 2020 19:08:30 +0000 (UTC) Received: from localhost ([::1]:43696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG5SH-0006w0-Ev for larch@yhetil.org; Wed, 09 Sep 2020 15:08:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG5KP-0007dQ-Th for guix-devel@gnu.org; Wed, 09 Sep 2020 15:00:21 -0400 Received: from dustycloud.org ([50.116.34.160]:37836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG5KN-0001UL-Dg for guix-devel@gnu.org; Wed, 09 Sep 2020 15:00:21 -0400 Received: from twig (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id D644226616; Wed, 9 Sep 2020 15:00:16 -0400 (EDT) References: <877dtj753p.fsf@gmail.com> User-agent: mu4e 1.4.12; emacs 26.3 From: Christopher Lemmer Webber To: Maxim Cournoyer Subject: Re: Setuid programs In-reply-to: <877dtj753p.fsf@gmail.com> Date: Wed, 09 Sep 2020 15:00:12 -0400 Message-ID: <871rja3hdv.fsf@dustycloud.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=50.116.34.160; envelope-from=cwebber@dustycloud.org; helo=dustycloud.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/09 15:00:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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 autolearn=ham autolearn_force=no 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: , Cc: guix-devel@gnu.org 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: -1.01 X-TUID: H5LHnLSYr9vK Maxim Cournoyer writes: > Hello Gabor! > > G=C3=A1bor Boskovits writes: > >> Hello guix, >> >> I would like to propose an extension to how setuid programs are >> currently handled. The last time I checked it could only do setuid and >> setgid root. Some services, such as postfix need a more fine grained >> setuid setup. I would propose a record type, such as: >> (setuid >> (program setuid-program) >> (setuid setuid-setuid) >> (setgid setuid-setgid) >> (user setuid-user) >> (group setuid-group)) >> >> So that there is more fine grained control. >> >> I would also propose to move this to the services framework, so that >> services could extend this field on demand. >> >> Wdyt? > > This sounds great! I also encountered such limitation and tried to > fixing it in https://issues.guix.info/41763, with some success (and an > unresolved limitation pointed by Chriistopher) but I agree that using a > record makes more sense and is more future proof. > > Maxim I'm eager to use Postfix on Guix (maybe it's me, but I just can't make sense of the weird DSL that opensmtpd uses) so I guess if that's what's necessary it already makes it a good idea. However I don't fully understand the syntax of what you proposed. Let's see if I can guess with a fake entry #~(setuid ;; The program to run, from the shady package (program (string-append #$shady "/bin/scaryfoo") ;; Would this be a boolean? If so should it be `setuid?` (setuid setuid-setuid) ;; Likewise? (setgid setuid-setgid) ;; Presumably the use we want to set this to (user setuid-user) ;; Presumably the group we want to se this to (group setuid-group)) ... right? I guess this could be done in a backwards compatible way; %setuid-programs could either evaluate to strings or records, so the "simpler" version can remain an option? - Chris