From nobody Thu May 16 20:05:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1606782553; cv=none; d=zohomail.com; s=zohoarc; b=DbIJ+Zfer2YkJNKvh6j7lZ3AJj/xi8p15B9i5IqVx0BCDaDSqqeAAq3ffhxeGI3/dGXF6lIqUzK7N/JT62AqW0EZvs2DowYte8dCgtLqbNwzolTAhdEvnNgV8MC7qycni4cQLZwIk70Ih6g9r4oEPo5M63CWW5s4ypdWic26sN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606782553; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=eiFsWlHrXSb3pdXjsQBbRubD4AOyAkFofbWuH7rtzlo=; b=HaEqR+1ITKAO/Djost4MDxWCfPZwanvU9E4KUAT5d/TboYFkFcU7ObqcBFabZCtPTBruYYHFBW3nUC/hWM3AJ3ihRHXu8ruX0WJzo7eRJquV87sK4FN0mCvxl+phLHQkvkJR26NAbmHGe+2EF/V8N05nLbI446SDSloLZr/7uuM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160678255326799.50962524519127; Mon, 30 Nov 2020 16:29:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-aRoioM6EN6-CXSp7X3NiEA-1; Mon, 30 Nov 2020 19:29:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 19EBD107464C; Tue, 1 Dec 2020 00:29:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C803A13470; Tue, 1 Dec 2020 00:29:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 823D6180954D; Tue, 1 Dec 2020 00:28:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B10SrlJ018789 for ; Mon, 30 Nov 2020 19:28:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 55D1B2026D49; Tue, 1 Dec 2020 00:28:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 500BD2026D46 for ; Tue, 1 Dec 2020 00:28:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E77B3185A7BC for ; Tue, 1 Dec 2020 00:28:50 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [62.140.7.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-Mg4eHblgPx66tkD9gk3uTA-1; Mon, 30 Nov 2020 19:28:48 -0500 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02lp2057.outbound.protection.outlook.com [104.47.4.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-30-asTVPv-XMvKluI7oho1UVQ-1; Tue, 01 Dec 2020 01:28:45 +0100 Received: from AM8PR04MB7761.eurprd04.prod.outlook.com (2603:10a6:20b:248::15) by AM8PR04MB7874.eurprd04.prod.outlook.com (2603:10a6:20b:24d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.25; Tue, 1 Dec 2020 00:28:43 +0000 Received: from AM8PR04MB7761.eurprd04.prod.outlook.com ([fe80::28ad:2119:382e:6dae]) by AM8PR04MB7761.eurprd04.prod.outlook.com ([fe80::28ad:2119:382e:6dae%7]) with mapi id 15.20.3611.031; Tue, 1 Dec 2020 00:28:43 +0000 Received: from linux-tbji.devlab.prv.suse.com (75.169.21.134) by AM0PR10CA0011.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:17c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Tue, 1 Dec 2020 00:28:42 +0000 X-MC-Unique: aRoioM6EN6-CXSp7X3NiEA-1 X-MC-Unique: Mg4eHblgPx66tkD9gk3uTA-1 X-MC-Unique: asTVPv-XMvKluI7oho1UVQ-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] polkit: Allow libvirt group access to libvirtd ro socket Date: Mon, 30 Nov 2020 17:28:16 -0700 Message-ID: <20201201002816.19011-1-jfehlig@suse.com> X-Originating-IP: [75.169.21.134] X-ClientProxiedBy: AM0PR10CA0011.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:17c::21) To AM8PR04MB7761.eurprd04.prod.outlook.com (2603:10a6:20b:248::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e3fb0abd-36bf-4334-2aab-08d895900ec2 X-MS-TrafficTypeDiagnostic: AM8PR04MB7874: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: duNDbYpp4fzM3QOAUfz8TW8g/1umQ5IbMHs4dsh3YCdAmjHzq8kQfLnFyxiNq8Z0MR7U07g2v0AeXVV3I1L4jET2kAQxBgyEthsSq440bovJft3K1okEelIYsPW2boDJ16NsFjXTfJsJKh/OxLAmanu5XNg/k1LkrW4ZcyxHnLcTimVP6vLxASVoKanQJW1yHu8P0XSBx34Hd4S8S2OG8JoV6bEvQK5Iy+maaydTlVVzvdEsoqgpTl9YDnB0l4kMYgkrsALwWnRstt4Dk/jE4fsF5g2g57RCY3Z5+BzVk2861BrwrMoZyQ6S934iQ/zEcB6LFRvAJzBynsI3SR95Vg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR04MB7761.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(136003)(39850400004)(396003)(346002)(376002)(8936002)(16526019)(8676002)(107886003)(36756003)(6486002)(66556008)(66946007)(478600001)(4326008)(66476007)(86362001)(2906002)(1076003)(316002)(6666004)(2616005)(6916009)(83380400001)(956004)(52116002)(5660300002)(7696005)(26005)(186003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?zGN4VEIlk9fo75FT1Cs8iIotGtwJNlSK7qz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yrBVN7YNri2UpkQjwJfY3tV+kAxJ1WetmalLB2jQM5wSv5jzAtrmnnhE7K?= =?us-ascii?Q?Chi98T/SD6Qw+zCCJ3NIZ+TNW/gZzfQs9jLQ/OY4KxknUPSwB9dSB92yC0YA?= =?us-ascii?Q?/tgy?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3fb0abd-36bf-4334-2aab-08d895900ec2 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7761.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2020 00:28:43.7311 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 52UTDUc4Uz3wdrbVCyhxAWbo7SlN650ycl9zR922Ipw1Hlr8AH3MxIYJJlrtKLFcLpw51EtIF4uLD0EsaUJH4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7874 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0B10SrlJ018789 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As a normal user, 'virsh connect qemu:///system' and 'virsh connect --readonly qemu:///system' will prompt for root password. If the user is added to the libvirt group, only 'virsh connect --readonly qemu:///system' will prompt for root password. The libvirt polkit rules already allow libvirt group members access to the rw socket. Add a rule allowing to access the ro socket. Signed-off-by: Jim Fehlig Reviewed-by: Neal Gompa --- src/remote/libvirtd.rules | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/remote/libvirtd.rules b/src/remote/libvirtd.rules index 01a15fac2e..d9be94fcc4 100644 --- a/src/remote/libvirtd.rules +++ b/src/remote/libvirtd.rules @@ -1,5 +1,12 @@ -// Allow any user in the 'libvirt' group to connect to system libvirtd -// without entering a password. +// Allow any user in the 'libvirt' group to connect to the system libvirtd +// ro and rw sockets without entering a password. + +polkit.addRule(function(action, subject) { + if (action.id =3D=3D "org.libvirt.unix.monitor" && + subject.isInGroup("libvirt")) { + return polkit.Result.YES; + } +}); =20 polkit.addRule(function(action, subject) { if (action.id =3D=3D "org.libvirt.unix.manage" && --=20 2.29.2