Skip to content

feat: enforce minimum password length of 8 characters with warning#1906

Open
jlima8900 wants to merge 8 commits intoKeeper-Security:releasefrom
jlima8900:feat/password-generator-minimum-pr1874
Open

feat: enforce minimum password length of 8 characters with warning#1906
jlima8900 wants to merge 8 commits intoKeeper-Security:releasefrom
jlima8900:feat/password-generator-minimum-pr1874

Conversation

@jlima8900
Copy link
Copy Markdown
Contributor

@jlima8900 jlima8900 commented Mar 28, 2026

Summary

  • Enforce minimum password length of 8 characters in the $GEN local record-field helper
  • $GEN:rand,<8> now clamps to 8 with a logging.warning instead of silently accepting values as low as 1

Contract change

This is an intentional policy change: generate_password() no longer honors explicit $GEN:rand,<N> requests where N < 8. Values below 8 are clamped to 8 with a warning. This prevents accidental creation of trivially weak passwords. The enterprise password-rule enforcement path (PasswordRule / DomainPasswordRulesRequest) is unaffected — this only applies to the local $GEN record-field helper.

Test plan

  • $GEN:rand,4 and $GEN:rand,6 clamp to length 8 with warning
  • $GEN:rand,8 produces length 8 with no warning
  • $GEN:rand,24 produces length 24 (no clamp)
  • Default $GEN (no params) and $GEN:rand produce length 20
  • $GEN:dice,5 and $GEN:crypto behavior unchanged
  • 9 unit tests in test_password_generator.py

@jlima8900 jlima8900 changed the base branch from master to release March 30, 2026 13:33
@jlima8900 jlima8900 force-pushed the feat/password-generator-minimum-pr1874 branch from 85aca92 to 20df48b Compare March 30, 2026 13:39
@jlima8900
Copy link
Copy Markdown
Contributor Author

@aaunario — ready for review. Min password length enforcement with 9 unit tests. Contract change documented in PR description.

@jlima8900 jlima8900 force-pushed the feat/password-generator-minimum-pr1874 branch 2 times, most recently from 926a79e to aa304ed Compare April 2, 2026 22:40
idimov-keeper and others added 3 commits April 3, 2026 20:59
* Added full terminal reset after ssh session exit (clears scrollback etc.)

* Fixes randomly eaten first characters typed after ssh session exit (stdin race condition)

* Fixed random duplicate typed characters (echo)
Keeper-Security#1908)

- Added `move` to the list of `apply-action` choices, which will move all returned users to a node - specified with `target-node`

- Added `all` to the list of `status` choices, returning invited, active and locked users with `d=0`

- Fixed an issue where the users updated with `apply-action` are not the same as those filtered with the `node` argument.

- Fixed a potential unwanted behavior where the `node` argument returns a recursive node and subnodes search, preventing you from applying actions to a specific node if it has subnodes. By default, using the `node` argument will only return result from the specified node.

- Added a `recursive` argument to replicate the old behavior with `node` filter.
- Clamp password length to 8-200 range with warnings
- Update help text: rand length: 8-200 (default 20)
- Add tests for zero length, above-200, and at-200 edge cases
@jlima8900 jlima8900 force-pushed the feat/password-generator-minimum-pr1874 branch from aa304ed to 429ef25 Compare April 4, 2026 10:36
@sk-keeper sk-keeper force-pushed the release branch 3 times, most recently from 442d7af to 9ec9b7a Compare April 15, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants