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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7FADC9D6EB for ; Mon, 5 Jun 2023 09:24:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 685BD24026 for ; Mon, 5 Jun 2023 09:24:35 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 5 Jun 2023 09:24:34 +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 1E69948909 for ; Mon, 5 Jun 2023 09:24:34 +0200 (CEST) Date: Mon, 05 Jun 2023 09:24:27 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20230526073347.1615981-1-aderumier@odiso.com> <20230526073347.1615981-2-aderumier@odiso.com> <1685705445.0kkr7b9mhh.astroid@yuna.none> <2ded7b16a00bb521fe45c166e668e2eb26f074f2.camel@groupe-cyllene.com> In-Reply-To: <2ded7b16a00bb521fe45c166e668e2eb26f074f2.camel@groupe-cyllene.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1685949820.13thlnnkk8.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 qemu-server 1/1] api2: add check_bridge_access for create/update vm 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: Mon, 05 Jun 2023 07:24:35 -0000 On June 2, 2023 2:12 pm, DERUMIER, Alexandre wrote: > Le vendredi 02 juin 2023 =C3=A0 13:43 +0200, Fabian Gr=C3=BCnbichler a = =C3=A9crit=C2=A0: >> a few more places that come to my mind that might warrant further >> thinking or discussion: >> - restoring a backup > doesn't it also use create_vm ? yes, but the potentially problematic parameters are coming from the backup in that case, not $param :) we do check the storage permissions at least, if we view nics on bridges/vnet as being the same kind of entity as volumes on storages than it would make sense to also check vnet permissions there (PVE::QemuServer -> $parse_backup_hints , but probably that is not the best place for network related checks ;)) > __PACKAGE__->register_method({ > name =3D> 'create_vm', > path =3D> '', > method =3D> 'POST', > description =3D> "Create or restore a virtual machine.", >=20 >=20 >> - cloning a VM >=20 > for cloning, we can't change the target bridge, so if user have access > to the clone, isn't it enough ? same as above - if we treat "volume on storage" and "nic in vnet" as being equivalent, then cloning would also need to check whether I am allowed to add new nics to a vnet via cloning (like we do for volumes, even without a storage override set!). $check_storage_access_clone is the current helper, a similar one could be added for nics. note: we'd also need a similar patch for pve-container ;) but if you want, I can handle that one once this series is done or almost done, the current approach is guest-agnostic anyway so I don't expect any changes required for container support.