From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 301F31FF0AA for ; Tue, 17 Nov 2026 14:30:42 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4F804216EC; Tue, 17 Nov 2026 14:30:17 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 17 Nov 2026 14:30:03 +0100 Message-Id: Subject: Re: [PATCH v2 access-control 4/19] fix #7805: api: token: enforce datacenter token policy To: "Thomas Lamprecht" , X-Mailer: aerc 0.20.0 References: <20261115194043.3947825-1-t.lamprecht@proxmox.com> <20261115194043.3947825-5-t.lamprecht@proxmox.com> In-Reply-To: <20261115194043.3947825-5-t.lamprecht@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794922203442 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.580 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) 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: QIQK5ASGJTIPE2VBKZ7ZTHTDAERFKGJE X-Message-ID-Hash: QIQK5ASGJTIPE2VBKZ7ZTHTDAERFKGJE X-MailFrom: s.sterz@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: this patch no longer applies for me On Sun Nov 15, 2026 at 8:40 PM CET, Thomas Lamprecht wrote: > Check the new datacenter.cfg token-policy option on API token > creation and update, so admins can centrally require expiration > dates, bound the maximum token lifetime, forbid extending existing > expiration dates, and require privilege separation, as commonly > mandated by compliance rules like PCI DSS, SOC 2, or ISO 27001. > > Existing tokens stay valid, and an update only checks settings it > actually changes, so unrelated edits or clients resubmitting > unchanged fields are not rejected for tokens that predate the policy. > The check runs before the secret is generated to avoid leaving an > orphaned entry in token.cfg on rejection. Regenerating the secret of > an existing token is deliberately not restricted: rotation does not > extend validity, and blocking it would only discourage rotating old > credentials. > > Changing the policy itself requires Sys.Modify on '/', like any > other datacenter option. No extra auth-specific privilege is added > for now, as it would end up in the same built-in roles that already > carry Sys.Modify and thus allow the same users, and anyone allowed to > change datacenter options can adapt the policy in any case. > > Signed-off-by: Thomas Lamprecht > --- > > changes since v1: > - pass the current expiration date instead of 'is-update', so that > 'disallow-expiry-extension' only rejects extending it > - use v5.36 in the tests -->8 snip 8<--