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 3E8841FF0AA for ; Tue, 17 Nov 2026 14:30:04 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A1C0121618; Tue, 17 Nov 2026 14:30:00 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 17 Nov 2026 14:29:53 +0100 Message-Id: Subject: Re: [PATCH v2 cluster/access-control/docs/manager/proxmox 0/19] fix #7805: add a datacenter-wide API token policy To: "Thomas Lamprecht" , X-Mailer: aerc 0.20.0 References: <20261115194043.3947825-1-t.lamprecht@proxmox.com> In-Reply-To: <20261115194043.3947825-1-t.lamprecht@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794922194011 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.593 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: MQC4SQIG37TELYRHI563CS3OYTMIVAV7 X-Message-ID-Hash: MQC4SQIG37TELYRHI563CS3OYTMIVAV7 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: On Sun Nov 15, 2026 at 8:40 PM CET, Thomas Lamprecht wrote: > Compliance rules like PCI DSS, SOC 2, or ISO 27001 often require > that credentials have a limited lifetime, but there is no central way > to enforce that for API tokens. > > Add an optional token-policy option to datacenter.cfg to require an > expiration date, limit the maximum token lifetime, forbid extending > the expiration date of existing tokens, and require privilege > separation. Two further opt-in settings help tools that manage their > own tokens: one gives tokens created without an expiration date the > maximum lifetime, the other allows extending a token if its secret is > regenerated in the same request. > > The policy is only checked when a token is created or updated, and > only for values that actually change, so existing tokens stay valid > even if their lifetime exceeds a newly configured maximum one. > Extending the expiration date within the limit stays possible, unless > the opt-in 'disallow-expiry-extension' switch is set (see [0] for the > rationale). > > The web UI exposes these options under Datacenter -> Options and > adjusts the token dialogs to the policy. Changing the policy requires > Sys.Modify on '/', like any other datacenter option; an extra > auth-specific privilege check was skipped for now, for the current > built-in roles it would land in the same roles as Sys.Modify, adding new > built-in roles here is IMO scope creep and this can still be done later > (with some more thoughts on how to handle all these datacenter options). > > FWIW, the first manager patch (10/19 overall) fixes a pre-existing issue > w.r.t. only submitting the expiration date when changed, which the > policy checks would expose more often, but it'd also make sense on its > own and could be applied independently already. > > The last four patches port the backend part to the common rust stack, so > PBS and PDM can opt in through their AccessControlConfig, and to prepare > moving pve-access-control over to rust later. Only the expiry parts > apply there, tokens in the rust stack always use separate ACLs, i.e. no > sharing with the underlying users there. > > Dependencies: access-control needs the cluster patches, manager needs > both, and building manager needs the pve-doc-generator with the new > online-help anchor from the docs patches (or ALLOW_MISSING=3D1), which is > why the docs patches come before the manager ones; the proxmox patches > are independent. d/control needs the respective versioned dependency > bumps added on applying, and the generated datacenter option reference > in pve-docs needs the usual make update once the cluster side is > packaged. > > Changes since v1 (thanks @Shannon for the review): > - rename 'disallow-expiry-changes' to 'disallow-expiry-extension', which > only rejects removing the expiration date or moving it later > - add the two settings for tools managing their own tokens, suggested by > Shannon. They are part of this series, not a follow-up, as nodes not > knowing them would drop the whole policy > - docs: warn to only configure the policy once all nodes are upgraded > - token dialog: follow the server clock, not the browser's > - rebase on current master; smaller changes are noted per patch > > [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=3D7805 thanks for the quick v2, looks good to me. just left a few nits, but nothing really worth blocking this over. couldn't test it as the patches for pve-access-control don't apply for me anymore, but consider this: Reviewed-by: Shannon Sterz