From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer v3 3/8] tui: raise minimum root password length to 8 characters
Date: Mon, 16 Dec 2024 10:41:01 +0100 [thread overview]
Message-ID: <20241216094114.476756-4-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
* added note about requirement in the UI
proxmox-installer-common/src/lib.rs | 3 +++
proxmox-tui-installer/src/main.rs | 10 +++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/proxmox-installer-common/src/lib.rs b/proxmox-installer-common/src/lib.rs
index 13acb89..3dc3bfb 100644
--- a/proxmox-installer-common/src/lib.rs
+++ b/proxmox-installer-common/src/lib.rs
@@ -17,3 +17,6 @@ pub const FIRST_BOOT_EXEC_NAME: &str = "proxmox-first-boot";
/// Maximum file size for the first-boot hook executable.
pub const FIRST_BOOT_EXEC_MAX_SIZE: usize = 1024 * 1024; // 1 MiB
+
+/// Minimum length for the root password
+pub const ROOT_PASSWORD_MIN_LENGTH: usize = 8;
diff --git a/proxmox-tui-installer/src/main.rs b/proxmox-tui-installer/src/main.rs
index 4385713..b33b6f7 100644
--- a/proxmox-tui-installer/src/main.rs
+++ b/proxmox-tui-installer/src/main.rs
@@ -20,6 +20,7 @@ use proxmox_installer_common::{
options::{email_validate, BootdiskOptions, NetworkOptions, TimezoneOptions},
setup::{installer_setup, LocaleInfo, ProxmoxProduct, RuntimeInfo, SetupInfo},
utils::Fqdn,
+ ROOT_PASSWORD_MIN_LENGTH,
};
mod setup;
@@ -422,7 +423,10 @@ fn password_dialog(siv: &mut Cursive) -> InstallerView {
let options = &state.options.password;
let inner = FormView::new()
- .child("Root password", EditView::new().secret())
+ .child(
+ "Root password [at least 8 characters]",
+ EditView::new().secret(),
+ )
.child("Confirm root password", EditView::new().secret())
.child(
"Administrator email",
@@ -447,8 +451,8 @@ fn password_dialog(siv: &mut Cursive) -> InstallerView {
.get_value::<EditView, _>(2)
.ok_or("failed to retrieve email")?;
- if root_password.len() < 5 {
- Err("password too short, must be at least 5 characters long".to_owned())
+ if root_password.len() < ROOT_PASSWORD_MIN_LENGTH {
+ Err(format!("password too short, must be at least {ROOT_PASSWORD_MIN_LENGTH} characters long"))
} else if root_password != confirm_password {
Err("passwords do not match".to_owned())
} else if let Err(err) = email_validate(&email) {
--
2.47.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-12-16 9:41 UTC|newest]
Thread overview: 11+ 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 ` [pve-devel] [PATCH installer v3 2/8] proxinstall: raise minimum root password length to 8 characters Christoph Heiss
2024-12-16 9:41 ` Christoph Heiss [this message]
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
2025-02-12 9:44 ` [pve-devel] [PATCH installer/{pve, pmg}-docs/proxmox-backup v3 0/8] raise minimum root password length to 8 characters Christoph Heiss
2025-02-24 11:16 ` [pve-devel] applied-series: " Thomas Lamprecht
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-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.