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 C07569ED4D for ; Fri, 3 Nov 2023 13:34:44 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9D41F1D546 for ; Fri, 3 Nov 2023 13:34:44 +0100 (CET) Received: from andy.basealt.ru (unknown [193.43.10.250]) by firstgate.proxmox.com (Proxmox) with ESMTP for ; Fri, 3 Nov 2023 13:34:40 +0100 (CET) Received: by andy.basealt.ru (Postfix, from userid 500) id 82D28140F17; Fri, 3 Nov 2023 15:26:27 +0300 (MSK) From: "Andrew A. Vasilyev" To: pve-devel@lists.proxmox.com Cc: "Andrew A. Vasilyev" Date: Fri, 3 Nov 2023 15:26:23 +0300 Message-Id: <20231103122623.24886-1-andy@altlinux.org> X-Mailer: git-send-email 2.33.8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy HEADER_FROM_DIFFERENT_DOMAINS 0.249 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [acl.pm, user.pm] X-Mailman-Approved-At: Fri, 03 Nov 2023 15:05:12 +0100 Subject: [pve-devel] [PATCH pve-access-control 1/1] add logging for ACL and user status change 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: Fri, 03 Nov 2023 12:34:44 -0000 Signed-off-by: "Andrew A. Vasilyev" --- src/PVE/API2/ACL.pm | 2 ++ src/PVE/API2/User.pm | 4 ++++ 2 files changed, 6 insertions(+) diff --git src/PVE/API2/ACL.pm src/PVE/API2/ACL.pm index f0c9efb..6ec23d7 100644 --- src/PVE/API2/ACL.pm +++ src/PVE/API2/ACL.pm @@ -183,8 +183,10 @@ __PACKAGE__->register_method ({ if ($param->{delete}) { delete ($node->{users}->{$username}->{$role}); + PVE::Cluster::log_msg('info', 'root@pam', "delete $role from $path for user '$username'"); } else { $node->{users}->{$username}->{$role} = $propagate; + PVE::Cluster::log_msg('info', 'root@pam', "add $role to $path for user '$username'"); } } diff --git src/PVE/API2/User.pm src/PVE/API2/User.pm index ed4cb70..87a5d77 100644 --- src/PVE/API2/User.pm +++ src/PVE/API2/User.pm @@ -283,6 +283,7 @@ __PACKAGE__->register_method ({ $usercfg->{users}->{$username}->{keys} = $param->{keys} if $param->{keys}; cfs_write_file("user.cfg", $usercfg); + PVE::Cluster::log_msg('info', 'root@pam', "create user '$username'"); }, "create user failed"); return undef; @@ -402,6 +403,7 @@ __PACKAGE__->register_method ({ $usercfg->{users}->{$username}->{keys} = $param->{keys} if defined($param->{keys}); cfs_write_file("user.cfg", $usercfg); + PVE::Cluster::log_msg('info', 'root@pam', "update user '$username'"); }, "update user failed"); return undef; @@ -463,6 +465,7 @@ __PACKAGE__->register_method ({ $partial_deletion .= ', ACLs'; cfs_write_file("user.cfg", $usercfg); + PVE::Cluster::log_msg('info', 'root@pam', "delete user '$userid'"); }; die "$@$partial_deletion\n" if $@; }, "delete user failed"); @@ -795,6 +798,7 @@ __PACKAGE__->register_method ({ delete $usercfg->{users}->{$userid}->{tokens}->{$tokenid}; cfs_write_file("user.cfg", $usercfg); + PVE::Cluster::log_msg('info', 'root@pam', "logout user '$userid'"); }, 'deleting token failed'); return; -- 2.33.8