From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YDpdJnV4A2Tt3gAAbAwnHQ (envelope-from ) for ; Sat, 04 Mar 2023 17:57:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0KpjJnV4A2QRCQEAauVa8A (envelope-from ) for ; Sat, 04 Mar 2023 17:57:25 +0100 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 5375C2B955 for ; Sat, 4 Mar 2023 17:57:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYVC0-00017d-Gh; Sat, 04 Mar 2023 11:57:08 -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 1pYVBy-00017I-88 for guix-patches@gnu.org; Sat, 04 Mar 2023 11:57:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYVBu-0005n0-8i for guix-patches@gnu.org; Sat, 04 Mar 2023 11:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYVBu-00065A-5G for guix-patches@gnu.org; Sat, 04 Mar 2023 11:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61462] Add support for file capabilities(7) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Mar 2023 16:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61462 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Tobias Geerinckx-Rice Cc: 61462@debbugs.gnu.org Received: via spool by 61462-submit@debbugs.gnu.org id=B61462.167794897123321 (code B ref 61462); Sat, 04 Mar 2023 16:57:02 +0000 Received: (at 61462) by debbugs.gnu.org; 4 Mar 2023 16:56:11 +0000 Received: from localhost ([127.0.0.1]:37573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYVB5-000645-5D for submit@debbugs.gnu.org; Sat, 04 Mar 2023 11:56:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYVB3-00063s-Ed for 61462@debbugs.gnu.org; Sat, 04 Mar 2023 11:56:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYVAy-0005bn-43; Sat, 04 Mar 2023 11:56:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=PAAw89UqmdjdF/wuphcngUyNER0pl569rIdvDpyGh00=; b=BvpfTBDwR421TFuXb8bb d4iES2zhoNAuI1g8ERF10DsXZaP5MGrvESgJRB/oZ6Qcyk8YcwlNCpAmHtHyWT3U5ezIlFICsaP2l pS0ETfYYFaagAckQbH87RO407RMpSb891hunAfTFrfyeUT5AKqi7q7+YfBofZDoFljz0k9F2ZgNUm d3uIvFkwq+/GvwhtWWZtreNN11e1qxyUkFc6CKvssWk9aQ3xUhb+zOoW0zfISH6yTDkJt3PPWzlrI CTyh8QpDWzv8CwEME4OdIS1MQyfhP2UHIfkMiSI2uZklIFQeM2YIsF1ZmFra0eKy2Q4+fNS3S+pUA 4H+/QzgY53wiGg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYVAw-0004iO-VL; Sat, 04 Mar 2023 11:56:03 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87r0uuehlr.fsf@nckx> Date: Sat, 04 Mar 2023 17:55:59 +0100 In-Reply-To: <87r0uuehlr.fsf@nckx> (Tobias Geerinckx-Rice's message of "Sun, 12 Feb 2023 21:37:54 +0100") Message-ID: <877cvwsbfk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677949045; a=rsa-sha256; cv=none; b=C0W/0rzVq/oFhzLZm4qpzhNW+Jg+MbwMWQvhAu7i1E0t8ybX528JsPVL2s3UhuiC2VbpF7 cQaWmtAYNfRy4D4lGAqfIpmi0EssqWbgar/BENBdPN0DLVdxx4j+zjsBz/cX+46YaXXooF vIgl1C4LJdP+z10TqdW8iAe4ENiRmLloYYl7JlIrvRUXbEXicghHuAAlaCzUnzSvM/xCHZ 8JjjQzNFx3qRm5dL+D/YcETHLDtlwmi2aEv4fIIUBs62xSTzf0hQa45U0GNUROnQ2Ydfuo MUM5/WvY4ru0cdt8eYB5MkmjP9L0pJL6R4nVo2mAUuharwjRUny4x49I65nn1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=BvpfTBDw; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-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=1677949045; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=PAAw89UqmdjdF/wuphcngUyNER0pl569rIdvDpyGh00=; b=ZXUHqDO6OwpL+Mp1LxFpR4itNT3ZBUHrvYb/IunIRRSPf/O4ioL/3PIJW8PTY09SuKvBpL P1RxVWQ/NpN+WEPe5OwN45T2Zn1v0vRTU9iSqAy/ZLqwo5XuzURMjjSn2ckxO2RKbcmysT PtULe1zg+r4N/3Ozhc5+Aow/HdKg2OHboRKy1ludUeY7nu7iRwD028StY6x26xKFsM/63+ EDTqpJgoOmwrfhSe1Mo5xdOhdsy4rxX4dI30vH7uOs/ujCcTmOX1XgwOMKUJuapDmFH4K4 /oS57ZAnqtfRe/ye8MSs276tL6DvOnL3cqEQIizCcRG6AjJak9G+RXYrEs3x4w== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.10 X-Spam-Score: -4.10 X-Migadu-Queue-Id: 5375C2B955 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=BvpfTBDw; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: Kkpcq9Py80MN Hi! Tobias Geerinckx-Rice skribis: > I need to offload some of my eternally rebased local patches. Here's > one that makes it easy to assign capabilities(7) =E2=80=94 currently thro= ugh > setcap(8) =E2=80=94 to programmes like we can set{u,g}id. > > There are many packages that benefit from this. Mine are: > > (privileged-programs > (cons* (privileged-program > (file-append mtr "/sbin/mtr") > (capabilities "cap_net_raw+ep")) > (privileged-program > (file-append nethogs "/sbin/nethogs") > (capabilities "cap_net_admin,cap_new_raw+ep")) > (privileged-program > (file-append light "/bin/light") > (setuid? #t)) > %default-privileged-programs)) Neat! > The set's over a year old and needs a bit of love. Some details might > have bitrot, I probably forgot a to-do or two in that year, and > there's something unguixy about calling setcap(8) instead of writing a > completely new Guile binding/module :-) > > I'm quite opinionated about the setuid-programs unification: there > should not be multiple confusing and masking layers of privilege, and > it should be possible to setgid a capable executable. So you mean that =E2=80=98privileged-programs=E2=80=99 should entirely repl= ace =E2=80=98setuid-programs=E2=80=99, right? I=E2=80=99m a bit unsure about using file capabilities: 1. File capabilities are persistent and less visible than setuid bits (you won=E2=80=99t see them with =E2=80=9Cls -l=E2=80=9D), so easily o= verlooked. Could there be a risk of lingering file capabilities when reconfiguring a system? 2. How =E2=80=99bout portability to different file systems and to GNU/Hur= d? 3. What=E2=80=99s the complexity/benefit ratio? :-) Then there=E2=80=99s the compatibility story with moving from /run/setuid-programs to /run/privileged-programs etc. that=E2=80=99ll have = to be handled with care. I=E2=80=99m very much sold to the principle of least authority, but I feel = like POSIX capabilities (not to be confused with =E2=80=9Cactual=E2=80=9D capabi= lities) are a bit of a hack. Thoughts? Ludo=E2=80=99.