diff --git a/changelog/63596.fixed b/changelog/63596.fixed new file mode 100644 index 000000000000..38c412786a01 --- /dev/null +++ b/changelog/63596.fixed @@ -0,0 +1 @@ +LGPO: Added support for "Relax minimum password length limits" diff --git a/salt/modules/win_lgpo.py b/salt/modules/win_lgpo.py index b7f3c9230544..e8ca41f4e1be 100644 --- a/salt/modules/win_lgpo.py +++ b/salt/modules/win_lgpo.py @@ -1826,6 +1826,18 @@ def __init__(self): }, "Transform": self.enabled_one_disabled_zero_no_not_defined_transform, }, + "RelaxMinimumPasswordLengthLimits": { + "Policy": "Relax minimum password length limits", + "lgpo_section": self.password_policy_gpedit_path, + "Settings": self.enabled_one_disabled_zero.keys(), + "Registry": { + "Hive": "HKEY_LOCAL_MACHINE", + "Path": "SYSTEM\\CurrentControlSet\\Control\\SAM", + "Value": "RelaxMinimumPasswordLengthLimits", + "Type": "REG_DWORD", + }, + "Transform": self.enabled_one_disabled_zero_transform, + }, "AdminAccountStatus": { "Policy": "Accounts: Administrator account status", "Settings": self.enabled_one_disabled_zero_no_not_defined.keys(), diff --git a/tests/pytests/functional/modules/win_lgpo/test_registry_policy.py b/tests/pytests/functional/modules/win_lgpo/test_registry_policy.py index 692795fab6cd..543bcc9c945e 100644 --- a/tests/pytests/functional/modules/win_lgpo/test_registry_policy.py +++ b/tests/pytests/functional/modules/win_lgpo/test_registry_policy.py @@ -107,6 +107,36 @@ def lgpo(modules): "REG_SZ", True, ), + ( + "RelaxMinimumPasswordLengthLimits", + "Enabled", + "HKLM", + "SYSTEM\\CurrentControlSet\\Control\\SAM", + "RelaxMinimumPasswordLengthLimits", + 1, + "REG_DWORD", + False, + ), + ( + "RelaxMinimumPasswordLengthLimits", + "Disabled", + "HKLM", + "SYSTEM\\CurrentControlSet\\Control\\SAM", + "RelaxMinimumPasswordLengthLimits", + 0, + "REG_DWORD", + False, + ), + ( + "RelaxMinimumPasswordLengthLimits", + "Not Defined", + "HKLM", + "SYSTEM\\CurrentControlSet\\Control\\SAM", + "RelaxMinimumPasswordLengthLimits", + "0", + "REG_DWORD", + True, + ), ], ) def test_reg_policy(