mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-28 02:15:56 +03:00
[GH-ISSUE #1422] Changing password scheme #1127
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Mar 4, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1422
I was asked yesterday on IRC if it's safe to change the
Default password scheme, I said no but I'm wrong. It is safe to changeDefault password schemebut there is one caveat.When Modoboa saves the hashed password to the database it prefixes it with the scheme so dovecot knows which scheme to use when validating passwords, if no scheme prefix is present it falls back to
default_pass_schemeset indovecot-sql.conf.ext. (Most SQL based admin interfaces don't prefix the password scheme, which is where I made the mistake)The one caveat is changing
Default password schemedoesn't automatically update all the stored passwords to the new scheme. This either needs done manually by getting each user to change their password or a post login script is required for dovecot to update the password when the user logs into imap/pop. (See Convert Password Schemes)@ghost commented on GitHub (Mar 4, 2018):
Another thing to note is BLF-CRYPT isn't available with dovecot 2.2 on MOST linux distributions, it is however included in dovecot 2.3. Dovecot Password Schemes.
dovecot pw -llists what scheme dovecot supports.@bobslee commented on GitHub (Mar 4, 2018):
Great info @fyfe Thanks!
I just put it on agenda to switch to bcrypt, when dovecot 2.3 is released.
@almereyda commented on GitHub (Oct 17, 2023):
Unfortunately it is not possible to recover a once hashed password (with salt) and to rehash it with another algorithm. This is only possible as described by a user changing their password.
Fortunately we have this setting, so people don't even need to change it, but login once (to the Modoboa admin interface, I guess):
Switching to the most up-to-date password scheme is still highly encouraged. Dovecot and Django just need to be of the same opinion here. Maybe it's good to follow good practices and use something more up to date than bcrypt:
Nextcloud for example used bcrypt ($2y prefix) for older accounts, but is now using Argon2i(d) for newer ones:
github.com/nextcloud/server@b4fec29e8e/lib/private/Security/Hasher.php (L85)Django supports other hashes via the Python
bcryptmodule, and preferablyargon2-cffi, as seen in the identity provider Authentik (which is also based on Django).Argon2ID is also supported in recent dovecot versions, if the local
libsodiumsupports it:With a little caveat on memory consumption of the
auth_workerand how to configure it for Argon2, but not Argon2id:We can check if our dovecot instance supports Argon2id by running this command from the dovecot documentation page: