From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 306F51FF15F for ; Mon, 7 Oct 2024 11:22:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 69F8A3AA6B; Mon, 7 Oct 2024 11:22:27 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Mon, 7 Oct 2024 11:22:15 +0200 Message-ID: <20241007092218.723938-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241007092218.723938-1-c.heiss@proxmox.com> References: <20241007092218.723938-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH installer 1/3] proxinstall: raise minimum root password length to 8 characters 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" .. in accordance with current NIST recommendations [0]. It's 2024; so reasonable to expect an 8-character-password at the minimum. [0] https://pages.nist.gov/800-63-4/sp800-63b.html#passwordver Signed-off-by: Christoph Heiss --- Proxmox/Makefile | 1 + Proxmox/Sys.pm | 6 ++++++ proxinstall | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Proxmox/Sys.pm diff --git a/Proxmox/Makefile b/Proxmox/Makefile index 035626b..edcabc1 100644 --- a/Proxmox/Makefile +++ b/Proxmox/Makefile @@ -12,6 +12,7 @@ PERL_MODULES=\ Install/RunEnv.pm \ Install/StorageConfig.pm \ Log.pm \ + Sys.pm \ Sys/Block.pm \ Sys/Command.pm \ Sys/File.pm \ diff --git a/Proxmox/Sys.pm b/Proxmox/Sys.pm new file mode 100644 index 0000000..41e5316 --- /dev/null +++ b/Proxmox/Sys.pm @@ -0,0 +1,6 @@ +package Proxmox::Sys; + +use strict; +use warnings; + +our $ROOT_PASSWORD_MIN_LENGTH = 8; diff --git a/proxinstall b/proxinstall index 12f3eaa..a4ed20b 100755 --- a/proxinstall +++ b/proxinstall @@ -33,6 +33,7 @@ my $iso_env = Proxmox::Install::ISOEnv::get(); use Proxmox::Install; use Proxmox::Install::Config; +use Proxmox::Sys; use Proxmox::Sys::Block qw(get_cached_disks); use Proxmox::Sys::Command qw(syscmd); use Proxmox::Sys::File qw(file_read_all file_write_all); @@ -720,8 +721,11 @@ sub create_password_view { my $t1 = $pwe1->get_text; my $t2 = $pwe2->get_text; - if (length ($t1) < 5) { - Proxmox::UI::message("Password is too short."); + if (length ($t1) < $Proxmox::Sys::ROOT_PASSWORD_MIN_LENGTH) { + Proxmox::UI::message( + "Password too short, must be at least " . + "$Proxmox::Sys::ROOT_PASSWORD_MIN_LENGTH characters long" + ); $pwe1->grab_focus(); return; } -- 2.46.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel