From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OKVXKvOXPmQ0kQAASxT56A (envelope-from ) for ; Tue, 18 Apr 2023 15:15:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QNpHKvOXPmQTFgAA9RJhRA (envelope-from ) for ; Tue, 18 Apr 2023 15:15:31 +0200 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 6279520758 for ; Tue, 18 Apr 2023 15:15:31 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1polAt-0003r5-HA; Tue, 18 Apr 2023 09:15:11 -0400 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 1polAl-0003qM-Bj for guix-patches@gnu.org; Tue, 18 Apr 2023 09:15:04 -0400 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 1polAl-00067D-2S for guix-patches@gnu.org; Tue, 18 Apr 2023 09:15:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1polAk-00034I-Fe for guix-patches@gnu.org; Tue, 18 Apr 2023 09:15:02 -0400 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: Tue, 18 Apr 2023 13:15: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: patch To: Vagrant Cascadian Cc: Tobias Geerinckx-Rice , 61462@debbugs.gnu.org Received: via spool by 61462-submit@debbugs.gnu.org id=B61462.168182367211736 (code B ref 61462); Tue, 18 Apr 2023 13:15:02 +0000 Received: (at 61462) by debbugs.gnu.org; 18 Apr 2023 13:14:32 +0000 Received: from localhost ([127.0.0.1]:58143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1polAF-00033E-G2 for submit@debbugs.gnu.org; Tue, 18 Apr 2023 09:14:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1polAC-00032r-1l for 61462@debbugs.gnu.org; Tue, 18 Apr 2023 09:14:30 -0400 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 1polA5-00062V-AP; Tue, 18 Apr 2023 09:14:21 -0400 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=ss+odpx0z7TOvlSzIVRtQnyeGqLYC8WjzsVyBIuPGh4=; b=Z0J0viJAm0vzO7nRLAWJ aGa92q4FvLo+N6ivBaMphYLKN8Aie/rofgORDTWFBV5gqp4RJqPo/M0lmbPJxDSPamHSSl/D15j+8 U0Idagklxx8iZamxBdF6T5If+Yp6f8ev1G8N57rrmwVTbTi/lr5okIduiBfov+FCB5Zd4agtN2wXV L6YPxFGkDn/HrMfHO4Y0P5aN1/xJ3CxbC4KZktkNWIs+7rOFcBCz/nL7Q8OX1DOE6MWuMcN/iyEy9 4/fdld7z5H/RIvmvW2wz9sOOX2scdUXk0dZf87QZaisfXlXv5cNIBcnjB07vPHnLJ+bWwzsjwMwDx ZnL8QpY7i1dFBQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1polA4-0002z6-0J; Tue, 18 Apr 2023 09:14:21 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87r0uuehlr.fsf@nckx> <877cvwsbfk.fsf@gnu.org> <87cz4y6a86.fsf@contorta> Date: Tue, 18 Apr 2023 15:14:16 +0200 In-Reply-To: <87cz4y6a86.fsf@contorta> (Vagrant Cascadian's message of "Thu, 23 Mar 2023 21:31:53 -0700") Message-ID: <87o7nlwcwn.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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Z0J0viJA; 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-Seal: i=1; s=key1; d=yhetil.org; t=1681823731; a=rsa-sha256; cv=none; b=LkkzjFa37Ph1lyeqf6Wu+e9givLY14LDEiL3Ud26MeISKhJRTTZA9ZHglU7eLZXS66+iYm deePw2iUSsJD4lrtUy67Pc74vlQDOWvs7AYDmayE8Y7td7yBUL+ca665xcXUajirS1IjfC y+YQtGmYyWW6d0gDLLCU4wDowcCLYSQ9TAxdFYI/PHMDuz2Cs0DtoV0sabXeMEr8GZ4I/Z nFFbTnyMEhIStK786niGvl3A6AbItbidVE8NeHnODKwBbntUFU3Pwel1JwQjbxfkvx2HUO MdHeZvLKI9h86VpnRMUFyYT2g6Va6krZdF1GljZfUpGUYejcuseM5YLwpnsxDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681823731; 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=ss+odpx0z7TOvlSzIVRtQnyeGqLYC8WjzsVyBIuPGh4=; b=iNsqbLMvsQojZWZIrAtmnqoQSPm9NFesf8sMgP9ccKjx9NkJ+Ta0AV0HPSfUmqb1fNeQEM MYYuGTs61rwGa17QhuacodTk2/t4/w0mZL5hf5EDvJZu1pE8mogbPKGMMRdxmQ5oAInY0M G09pCPmwf7eC4vC0w8UpwQ33Cpp/Dhx96a/NjJcHPBsxY4SdrII6iP5bNJmt1nOMTkbLll 2yHhW38xWbQ4n/cXnJnmmFnG8txcDLv2YUlNijH+AV2oaZN4k1FoTpSDt5dacJCC8p1voJ J6YYDvEBLEtDLvBBJYsFjopHbLeHKauMLqneXpIdkF7GXT4jLH5a499vk7o01g== X-Migadu-Spam-Score: -3.82 X-Spam-Score: -3.82 X-Migadu-Queue-Id: 6279520758 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Z0J0viJA; 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: 8tc6p5/aK6x1 Hi Vagrant & Tobias, Sorry for the late reply! Vagrant Cascadian skribis: >>> 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 r= eplace >> =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 easil= y overlooked. Could >> there be a risk of lingering file capabilities when reconfiguring a >> system? > > Does reconfigure leave old setuid binaries laying around in > /run/setuid-programs currently? No: =E2=80=98activate-setuid-programs=E2=80=99 first deletes /run/setuid-pr= ograms/*, then populates it. > Seems like with setuid/setgid and the proposed priviledged binaries, the > setuid/setgid bits and capabilties should be explicitly set on any > defined binaries, and any that are left over in the /run/*-programs > directories should be... forcibly removed! Otherwise your current system > is vulnerable to previous potentially bad choices indefinitely... Right, so in that sense it=E2=80=99s no different from setuid binaries, oth= er than the fact that =E2=80=9Cls -l=E2=80=9D won=E2=80=99t show it. >> 2. How =E2=80=99bout portability to different file systems and to GNU/= Hurd? > > Currently I *think* /run/setuid-programs is tmpfs It=E2=80=99s not by default. [...] > In all seriousness though, while I appreciate thinking about broad > compatibility across different types of systems, I am a bit nervous > about an approach that would require features to behave compatibly > across all systems... I guess All I=E2=80=99m saying is that we should keep this in mind. Perhaps the hypothetical =E2=80=98activate-privileged-programs=E2=80=99 pro= cedure would fall back to setuid-root on GNU/Hurd or do some other Hurd-specific thing. We don=E2=80=99t need to go too far, but we do need to give it some thought IMO. >> I=E2=80=99m very much sold to the principle of least authority, but I fe= el like >> POSIX capabilities (not to be confused with =E2=80=9Cactual=E2=80=9D cap= abilities) are a >> bit of a hack. > > And setuid/setgid is not a hack? It seems like essentially the same > thing, just with no granularity... That=E2=80=99s right! > There are some things that are just not possible without capabilities, > and setuid/setgid is a dangerous hammer that should be used very > sparingly, if at all, and capabilities are no *worse* that > setuid/setgid, allowing a finer grained set of problems :) > > The need for this functionality has come up more than a few times: > > https://issues.guix.gnu.org/27415 > https://issues.guix.gnu.org/39136 > https://issues.guix.gnu.org/55683 Right; thanks for digging the references. I wouldn=E2=80=99t want to block this change. Tobias, if you=E2=80=99re ar= ound, let=E2=80=99s look more closely how we can address Hurd suppot and backward compatibility. Thanks, Ludo=E2=80=99.