Log password requirement details in demo environment#4071
Log password requirement details in demo environment#4071DarshitChanpura merged 3 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Cameron Durham <[email protected]>
src/test/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurerTests.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/ConfigConstants.java
Outdated
Show resolved
Hide resolved
peternied
left a comment
There was a problem hiding this comment.
Thanks for the pull request @camerondurham - minor comments
src/main/java/org/opensearch/security/support/ConfigConstants.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurerTests.java
Outdated
Show resolved
Hide resolved
DarshitChanpura
left a comment
There was a problem hiding this comment.
Thank you @camerondurham for this improvement. Left some comments after taking an initial pass.
src/main/java/org/opensearch/security/support/ConfigConstants.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurerTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Cameron Durham <[email protected]>
src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java
Show resolved
Hide resolved
src/test/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurerTests.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/ConfigConstants.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4071 +/- ##
=======================================
Coverage 65.88% 65.89%
=======================================
Files 298 298
Lines 21338 21341 +3
Branches 3473 3472 -1
=======================================
+ Hits 14058 14062 +4
+ Misses 5541 5539 -2
- Partials 1739 1740 +1
|
src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java
Show resolved
Hide resolved
|
Thanks for the contribution @camerondurham ! |
There was a problem hiding this comment.
@camerondurham the settings plugins.security.restapi.password_min_length and plugins.security.restapi.password_score_based_validation_strength come into play once the security plugin is setup and cluster is ready, which is when all the config settings are read.
However, in case of demo configuration script execution, these settings are not available to be read, as the tools write opensearch.yml with security-related settings necessary for cluster start-up. [See this]
In case if we try to pass these settings in opensearch.yml, the demo script will stop execution since it thinks that security plugin is already setup because it is able to find plugins.security.<setting> already defined in opensearch.yml [check this out]
I think we are overthinking this. The regex + password length supplied here are one time use before a fresh cluster start-up. We can leave those settings as is and modify the log message to focus on the scope of this PR. Thoughts?
src/test/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurerTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Cameron Durham <[email protected]>
|
Thank you for this contribution @camerondurham ! |
Signed-off-by: Cameron Durham <[email protected]> (cherry picked from commit f3b5727) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…4082) Backport f3b5727 from #4071. Signed-off-by: Cameron Durham <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ect#4071) Signed-off-by: Cameron Durham <[email protected]>
Description
Logs details about the password validations done when demo clusters are created. The current message "Password $ADMIN_PASSWORD is weak. Please re-try with a stronger password." doesn't provide enough information communicate what the user needs to set the password to.
Password sample@1029 is weak. Please re-try with a stronger password.Password weakpassword failed validation with error "Weak password". Please re-try with a minimum 8 character password that is "strong" per zxcvbn validation.Issues Resolved
Potentially can resolve #4048, though would need issue author @derek-ho to confirm this is the intended change.
Testing
Updated existing unit test that tests "password validation failure".
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.