-
Notifications
You must be signed in to change notification settings - Fork 15
IBX-10124: Add support for Argon2 password hashes #581
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
base: main
Are you sure you want to change the base?
Conversation
29547bd
to
5319d16
Compare
7f82ac9
to
683231f
Compare
f38f8ac
to
c3a42ad
Compare
@konradoboza How do you think it looks now? I removed the on-login code, and fixed other test failures that came up. |
Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
This reverts commit 2d86b6f.
Co-authored-by: Adam Wójs <adam@wojs.pl>
1e23d25
to
049ef92
Compare
|
2f60dd3 Now passing just the settings I need to the password hash service, not the whole $repositoryConfigurationProvider. Also doing this after construction to avoid circular dependency with the RepositoryFactory. |
Related PRs:
Description:
Add support for PASSWORD_ARGON2I and PASSWORD_ARGON2ID password hash types, which increase security over the standard bcrypt. Long enough bcrypt hashes are still considered secure, but there are some recommendations to upgrade to Argon2.
Before this PR,
UserService::updateUserPassword()
always goes with the current hashtype the user has. It seems that the code we had for updating hash type from md5 to bcrypt long ago was removed when we removed md5 support.PR goals
2) for whether existing users should be upgraded to the default hash type on login.If configured (default: no) the hash type will be changed when the user logs in, and changes in PHP's default hash options will take effect.Manual tests
Enabled by adding this config to ibexa.yaml
ibexa:system:default:
in v5.0.0:Convenient query for verifying that hash types are updated:
select login, password_hash_type, substring(password_hash,1,62), from_unixtime(password_updated_at) as updated_at from ibexa_user;
Logging in: Works, hash type is upgraded when enabledThe current test failures hint at a deeper problem with prioritizing Ibexa's CheckPassportEvent subscriber before the Symfony one. This is however required in order to upgrade the password hash on login, because the Symfony subscriber "eats" the password.Performance
Upgrade on login adds a db write to login when the upgrade happens (once per user), but after that there are no extra db calls, just the password_needs_rehash() call.Followup, not needed in this PR:
Read more
Documentation:
Docs that need an update:
https://doc.ibexa.co/en/latest/content_management/field_types/field_type_reference/userfield/#available-password-hash-types
https://doc.ibexa.co/en/latest/infrastructure_and_maintenance/security/security_checklist/#use-secure-password-hashing