From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 5A1C01FF0DE for ; Thu, 19 Nov 2026 13:47:46 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7EFEE216DD; Thu, 19 Nov 2026 13:47:45 +0100 (CET) From: David Riley To: pve-devel@lists.proxmox.com Subject: [PATCH pve-access-control v5 1/6] rpcenv: allow SDN.Allocate to modify permissions on SDN paths Date: Thu, 19 Nov 2026 13:47:26 +0100 Message-ID: <20261119124731.84602-2-d.riley@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119124731.84602-1-d.riley@proxmox.com> References: <20261119124731.84602-1-d.riley@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795092461509 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.552 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 3DBELXYEVQY27BYDAHD4R6CZPHTLYM32 X-Message-ID-Hash: 3DBELXYEVQY27BYDAHD4R6CZPHTLYM32 X-MailFrom: d.riley@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Modifying permissions on a path requires 'Permissions.Modify' on that path. Some paths accept another privilege on the same path instead: 'VM.Allocate' on /vms/, 'Datastore.Allocate' on /storage/ and 'Pool.Allocate' on /pool/. SDN paths had no such exception, so adding a VNet to a resource pool required 'Permissions.Modify', even for users who are allowed to allocate the VNet itself. Accept 'SDN.Allocate' on paths below /sdn in the same way. Besides the pool API, this also affects the ACL API. Users with 'SDN.Allocate' on an SDN path, for example via the PVESDNAdmin role, can now view and change the ACLs on that path. As with the other exceptions, they can only grant or revoke a subset of their own privileges, and only grant with propagation where their own privileges propagate. Fixes: edc2154 ("fix #7294: acl: pool: add SDN VNets as pool members") Signed-off-by: David Riley --- src/PVE/RPCEnvironment.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/RPCEnvironment.pm b/src/PVE/RPCEnvironment.pm index 0104b1e..09854d5 100644 --- a/src/PVE/RPCEnvironment.pm +++ b/src/PVE/RPCEnvironment.pm @@ -524,6 +524,8 @@ sub check_perm_modify { push @$testperms, 'Datastore.Allocate'; } elsif ($path =~ m|^/vms/.+$|) { push @$testperms, 'VM.Allocate'; + } elsif ($path =~ m|^/sdn/.+$|) { + push @$testperms, 'SDN.Allocate'; } elsif ($path =~ m|^/pool/.+$|) { push @$testperms, 'Pool.Allocate'; } -- 2.47.3