public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer v3 2/8] proxinstall: raise minimum root password length to 8 characters
Date: Mon, 16 Dec 2024 10:41:00 +0100	[thread overview]
Message-ID: <20241216094114.476756-3-c.heiss@proxmox.com> (raw)
In-Reply-To: <20241216094114.476756-1-c.heiss@proxmox.com>

.. 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@proxmox.com>
---
Changes v2 -> v3:
  * no changes

Changes v1 -> v2:
  * rebased on latest master
  * adapted html templates

 Proxmox/Sys.pm      | 5 +++++
 html/pbs/passwd.htm | 2 +-
 html/pmg/passwd.htm | 2 +-
 html/pve/passwd.htm | 2 +-
 proxinstall         | 7 +++++--
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Proxmox/Sys.pm b/Proxmox/Sys.pm
index afc6780..b10deb7 100644
--- a/Proxmox/Sys.pm
+++ b/Proxmox/Sys.pm
@@ -7,3 +7,8 @@ use warnings;
 # https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
 # Using that /should/ cover all possible cases that are encountered in the wild.
 our $EMAIL_RE = '^[a-zA-Z0-9.!#$%&\'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$';
+
+# Minimum password length for the root account.
+# See also https://pages.nist.gov/800-63-4/sp800-63b.html#passwordver for the
+# recommendation.
+our $ROOT_PASSWORD_MIN_LENGTH = 8;
diff --git a/html/pbs/passwd.htm b/html/pbs/passwd.htm
index d331b28..f275a6f 100644
--- a/html/pbs/passwd.htm
+++ b/html/pbs/passwd.htm
@@ -27,7 +27,7 @@
       <tr>
         <td valign="top" width="30"><img src="plus.png"></td>
         <td valign="top"><b>Password:</b>
-          Please use a strong password. It should be at least 8 characters long,
+          Please use a strong password. It must be at least 8 characters long,
           and contain a combination of letters, numbers, and symbols.
           <br><br>
         </td>
diff --git a/html/pmg/passwd.htm b/html/pmg/passwd.htm
index 3e94480..32b74f9 100644
--- a/html/pmg/passwd.htm
+++ b/html/pmg/passwd.htm
@@ -27,7 +27,7 @@
       <tr>
 	<td valign="top" width="30"><img src="plus.png"></td>
 	<td valign="top"><b>Password:</b>
-	  Please use a strong password. It should have 8 or more characters.
+	  Please use a strong password. It must have 8 or more characters.
 	  Also combine letters, numbers, and symbols.
 	  <br><br>
 	</td>
diff --git a/html/pve/passwd.htm b/html/pve/passwd.htm
index 1c7d2fc..b70e37c 100644
--- a/html/pve/passwd.htm
+++ b/html/pve/passwd.htm
@@ -27,7 +27,7 @@
       <tr>
 	<td valign="top" width="30"><img src="plus.png"></td>
 	<td valign="top"><b>Password:</b>
-	  Please use a strong password. It should be at least 8 characters long,
+	  Please use a strong password. It must be at least 8 characters long,
 	  and contain a combination of letters, numbers, and symbols.
 	  <br><br>
 	</td>
diff --git a/proxinstall b/proxinstall
index 8168529..2c399d2 100755
--- a/proxinstall
+++ b/proxinstall
@@ -721,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.47.0



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2024-12-16  9:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16  9:40 [pve-devel] [PATCH installer/{pve, pmg}-docs/proxmox-backup v3 0/8] " Christoph Heiss
2024-12-16  9:40 ` [pve-devel] [PATCH installer v3 1/8] common: convert `InstallRootPassword` into an enum Christoph Heiss
2024-12-16  9:41 ` Christoph Heiss [this message]
2024-12-16  9:41 ` [pve-devel] [PATCH installer v3 3/8] tui: raise minimum root password length to 8 characters Christoph Heiss
2024-12-16  9:41 ` [pve-devel] [PATCH installer v3 4/8] auto: " Christoph Heiss
2024-12-16  9:41 ` [pve-devel] [PATCH installer v3 5/8] auto: add negative tests for root password option Christoph Heiss
2024-12-16  9:41 ` [pve-devel] [PATCH pve-docs v3 6/8] installation: adapt to raised root password length requirement Christoph Heiss
2024-12-16  9:41 ` [pve-devel] [PATCH pmg-docs v3 7/8] " Christoph Heiss
2024-12-16  9:41 ` [pve-devel] [PATCH proxmox-backup v3 8/8] using-the-installer: " Christoph Heiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241216094114.476756-3-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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