From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 88BFA9DF25 for ; Tue, 6 Jun 2023 14:37:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6A75C34D07 for ; Tue, 6 Jun 2023 14:37:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 6 Jun 2023 14:37:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id AB60248C1E for ; Tue, 6 Jun 2023 14:37:11 +0200 (CEST) Date: Tue, 06 Jun 2023 14:37:05 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20230604233709.1340089-1-aderumier@odiso.com> <20230604233709.1340089-6-aderumier@odiso.com> <1685959517.z2meca7bd4.astroid@yuna.none> <4fa9803b8b1477506d9cfe463c021d2cf321a022.camel@groupe-cyllene.com> In-Reply-To: <4fa9803b8b1477506d9cfe463c021d2cf321a022.camel@groupe-cyllene.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1686054725.meyfrhscr2.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.073 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH pve-access-control 2/2] rpcenvironnment: add check_sdn_bridge X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2023 12:37:12 -0000 On June 6, 2023 2:15 pm, DERUMIER, Alexandre wrote: >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# check propagate on bridge= itself >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 1 if $self->check_an= y($username, $path, $privs, >> > $noerr); >>=20 >> this doesn't actually check propagation though? for that you could >> either: >> - use $self->permissions (it returns the propagate bit) >> - query a non-existing vlan child path with check_any >>=20 >>=20 >=20 > do we really need to check propagation ? >=20 > Here, we want to check if user have permission to the bridge, >=20 > if user have an acl on a vlan of the bridge >=20 > or=20 >=20 > if user have access to the bridge (propagate or not). >=20 > for example, if I check with a dummy vlanid ,/sdn/zones/myzone/vnet1/0, >=20 > It'll be ok if user have propagate on vnet1, but not if user > don't have propagate you are right, we don't need to check for propagation here. so basically we have two parts - maybe those could be added as a comment, and another higher-level one for the whole helper to make it clear what it actually checks: # checks whether user has $privs on the bridge/vnet in any fashion sub check_sdn_bridge { .. # check explicit VLAN tag ACLs .. # check bridge/vnet itself .. } and then we could also turn the order around, and check the bridge first as a fast path that does less work?