[pve-devel] [PATCH installer 1/3] proxinstall: raise minimum root password length to 8 characters

Christoph Heiss c.heiss at proxmox.com
Mon Oct 7 11:22:15 CEST 2024


.. 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 <c.heiss at proxmox.com>
---
 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





More information about the pve-devel mailing list