public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [RFC PATCH acces-control] auth: require quorum for ticket creaton of non PAM users
@ 2022-10-24 10:03 Dominik Csapak
  0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2022-10-24 10:03 UTC (permalink / raw)
  To: pve-devel

when the current node is not part of the quorate partition, there is no
way to determine if a user has the proper permissions or is even still
enabled, so we should prevent ticket creation for these users.

The only exception we should make is for node-local users (PAM realm),
since there is a good chance those can login via console/ssh anyway, and
it's good to have at least some users as fallback that can still login
in such cases.

This does not prevent users from using already created tickets, nor does
it prevent api calls with api tokens (that would have to be done
elsewhere).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
sending as rfc, since i'm not completely sure that's what @Wolfgang and
@Thomas had in mind in [0], since it's not touching api tokens at all

0: https://lists.proxmox.com/pipermail/pve-devel/2022-October/054406.html

 src/PVE/API2/AccessControl.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/API2/AccessControl.pm b/src/PVE/API2/AccessControl.pm
index 104e7e3..eb0543a 100644
--- a/src/PVE/API2/AccessControl.pm
+++ b/src/PVE/API2/AccessControl.pm
@@ -143,6 +143,9 @@ my sub verify_auth : prototype($$$$$$$) {
 my sub create_ticket_do : prototype($$$$$$) {
     my ($rpcenv, $username, $pw_or_ticket, $otp, $new_format, $tfa_challenge) = @_;
 
+    # allow login for non-quorate clusters only for node-local @pam users
+    PVE::Cluster::check_cfs_quorum() if $username !~ m/\@pam$/;
+
     die "TFA response should be in 'password', not 'otp' when 'tfa-challenge' is set\n"
 	if defined($otp) && defined($tfa_challenge);
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-24 10:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 10:03 [pve-devel] [RFC PATCH acces-control] auth: require quorum for ticket creaton of non PAM users Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal