Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FINERACT-2081: Update password policy #4141

Conversation

leksinomi
Copy link
Contributor

@leksinomi leksinomi commented Oct 31, 2024

Description

Update password validation to ensure consistency across application layers.

Ignore if these details are present on the associated Apache Fineract JIRA ticket.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests

  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.

  • Create/update unit or integration tests for verifying the changes made.

  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding Conventions.

  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes

  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code Review Guide.

@leksinomi leksinomi force-pushed the bugfix/FINERACT-2081/strengthen_password_policy branch 4 times, most recently from 713748b to 6b1e967 Compare November 1, 2024 08:40
@leksinomi leksinomi changed the title FINERACT-2081: Enforce stricter password policy FINERACT-2081: Update password policy Nov 1, 2024
@leksinomi leksinomi force-pushed the bugfix/FINERACT-2081/strengthen_password_policy branch 3 times, most recently from 78083d0 to c5c77af Compare November 1, 2024 12:13
@@ -32,6 32,8 @@ public class ApiProperties {
private String username;
@Value("${fineract-test.api.password}")
private String password;
@Value("${fineract-test.api.valid-password}")
Copy link
Contributor

@adamsaghy adamsaghy Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "valid password" means? Why do we need this one? why the "password" field is changed to this everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E2E tests create users for testing purpose. After I switched password validation policy the "password" value is no longer valid when creating new users or changing the passwords.

<column name="regex" value="^(?!.*(.)\1)(?!.*\s)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\w\s]).{12,50}$"/>
<column name="description" value="Password must be 12 to 50 characters long, containing at least one uppercase letter, one lowercase letter, one numeric digit, and one special character, with no spaces or consecutive repeating characters"/>
<column name="active" value="1"/>
<where>id = 2</where>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not override existing password policy, rather introduce new and set that as active

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -20,6 20,7 @@
fineract-test.api.base-url=${BASE_URL:https://localhost:8443}
fineract-test.api.username=${TEST_USERNAME:mifos}
fineract-test.api.password=${TEST_PASSWORD:password}
fineract-test.api.valid-password=${TEST_VALID_PASSWORD:A1b2c3d4e5f$}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind to rename it to "strong password"? This valid password is misleading to me..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@leksinomi leksinomi force-pushed the bugfix/FINERACT-2081/strengthen_password_policy branch 15 times, most recently from 7ec3929 to f441779 Compare November 5, 2024 15:41
@galovics
Copy link
Contributor

galovics commented Nov 5, 2024

@adamsaghy I'd like to check this myself. Please do not merge yet.

@@ -37,6 37,7 @@ jobs:
BASE_URL: https://localhost:8443
TEST_USERNAME: mifos
TEST_PASSWORD: password
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for keeping the original password here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "mifos/password" credentials have a "Super user" role. They are used for all necessary preparations required for testing.

Comment on lines 25 to 38
<changeSet author="fineract" id="1">
<update tableName="m_password_validation_policy">
<column name="active" valueBoolean="false"/>
<where>active=true</where>
</update>
</changeSet>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would disable any policy which is set to active. That means if somebody already created a separate password policy for their use, this change could break their functionality.

I'd say only disable the one Fineract is shipped with. Nothing more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix that in a next commit, thanks!

@leksinomi leksinomi force-pushed the bugfix/FINERACT-2081/strengthen_password_policy branch from f441779 to e5520f8 Compare November 7, 2024 18:09
@leksinomi leksinomi force-pushed the bugfix/FINERACT-2081/strengthen_password_policy branch from e5520f8 to 3728a13 Compare November 7, 2024 21:25
@leksinomi
Copy link
Contributor Author

Hi @galovics, I've updated the PR. Please review.

Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@galovics galovics merged commit 832b84f into apache:develop Nov 11, 2024
9 checks passed
@leksinomi leksinomi deleted the bugfix/FINERACT-2081/strengthen_password_policy branch November 11, 2024 09:32
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.

3 participants