Skip to content

Build OpenLDAP pw-argon2 module for Argon2 key derivation function#117

Merged
umagmrit merged 23 commits intoZimbra:ZBUG-3120from
ghen2:openldap-argon2
Dec 28, 2022
Merged

Build OpenLDAP pw-argon2 module for Argon2 key derivation function#117
umagmrit merged 23 commits intoZimbra:ZBUG-3120from
ghen2:openldap-argon2

Conversation

@ghen2
Copy link
Copy Markdown
Contributor

@ghen2 ghen2 commented Nov 18, 2020

Update libsodium to 1.0.18 and OpenLDAP to 2.4.50 to include argon2 support.

See https://en.wikipedia.org/wiki/Argon2 for more information, and contrib/slapd-modules/passwd/argon2/README for OpenLDAP specific notes.

olcPasswordHash can be set to {ARGON2} (from current {SSHA512}) to use argon2 password hashes by default.

Tested on Centos 7. Debian build scripts adjusted but not validated.

ghen2 and others added 4 commits November 18, 2020 22:43
…function.

See https://en.wikipedia.org/wiki/Argon2 for more information, and
contrib/slapd-modules/passwd/argon2/README for OpenLDAP specific notes.

Requires OpenLDAP >= 2.4.50 and libsodium >= 1.0.9.

olcPasswordHash can be set to {ARGON2} (from current {SSHA512}) to use argon2
password hashes by default.
@quanah
Copy link
Copy Markdown
Contributor

quanah commented Dec 17, 2020

OpenLDAP 2.4.50 is not safe to use with replication, update must be to 2.4.56 or later. See my pull request for updating to 2.4.56.

@ghen2
Copy link
Copy Markdown
Contributor Author

ghen2 commented Dec 17, 2020

@quanah You're still missing some bits in #118, like 1d9de9d?

@quanah
Copy link
Copy Markdown
Contributor

quanah commented Dec 17, 2020

I was simply updating the multival patch. I assume the Zimbra developers can maintain the rest of the system, which is what I was told when I quit 4 years ago.

@ghen2
Copy link
Copy Markdown
Contributor Author

ghen2 commented Dec 18, 2020

For clarity, this pull request is a complete upgrade to OpenLDAP to 2.4.56, with Argon2 support added (which requires newer libsodium as well).

@quanah
Copy link
Copy Markdown
Contributor

quanah commented Dec 21, 2020

You may want to change the default password hash in the configs to argon2 as well, so as passwords change they automatically make use of it. The SSHA2 pw module will continue to need to be loaded, but doesn't need to be the default.

@ghen2 ghen2 mentioned this pull request Jun 28, 2021
Prashantsurana and others added 3 commits June 29, 2021 02:11
…ackages into Zimbra-feature/openldap-2.4.56

Conflicts:
	thirdparty/openldap/patches/ITS7683.patch
	thirdparty/openldap/patches/multival.patch
	thirdparty/openldap/zimbra-openldap/rpm/SPECS/openldap.spec
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 29, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ ghen2
✅ quanah
✅ umagmrit
❌ Prashantsurana


Prashantsurana seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ghen2 ghen2 changed the base branch from develop to feature/nginx-sub-module June 29, 2021 08:56
@ghen2 ghen2 changed the base branch from feature/nginx-sub-module to feature/openldap-2.4.56 June 29, 2021 08:56
@Prashantsurana Prashantsurana force-pushed the feature/openldap-2.4.56 branch from 24ef9c0 to b922dcd Compare July 13, 2021 18:45
@ghen2 ghen2 changed the base branch from feature/openldap-2.4.56 to develop July 13, 2021 19:42
@ghen2 ghen2 changed the base branch from develop to ZBUG-3120 December 21, 2022 10:46
@ghen2
Copy link
Copy Markdown
Contributor Author

ghen2 commented Dec 21, 2022

PR has been updated for OpenLDAP 2.5.13, where pw-argon2 is now a standard release module, no longer a contrib module. Only needs --with-argon2 (and more recent libsodium).

@umagmrit umagmrit merged commit 7d1c728 into Zimbra:ZBUG-3120 Dec 28, 2022
@umagmrit
Copy link
Copy Markdown
Contributor

@ghen2 if we add pw-argon2 module, what will be the default password hash ? We don't want to change the current password hash. Could you please also share impacted areas and testing scope of this new module ?

@ghen2
Copy link
Copy Markdown
Contributor Author

ghen2 commented Dec 28, 2022

This PR only builds the argon2 module, it is not loaded or used by default. SSHA512 is still the default password hash.

OpenLDAP cn=config needs to be changed in two places: olcModuleLoad to load the argon2 module, and olcPasswordHash to use it by default for new passwords.

See the migrate20140728-AddSSHA512.pl script where the pw-sha2 module and SSHA512 default were introduced.

@ghen2 ghen2 deleted the openldap-argon2 branch December 28, 2022 10:40
@quanah
Copy link
Copy Markdown
Contributor

quanah commented Jan 8, 2023

It would be necessary to ensure that the SSHA512 module continues to be loaded in slapd so the existing hashes continue to function, but I agree switching to ARGON2 is critical. I would note that the argon2 library (vs libsodium) offers more configuration options for the hashes, which may be desirable, but adds another library to the zimbra buildout.

umagmrit added a commit that referenced this pull request Mar 7, 2023
)

* Update libsodium to 1.0.18 for argon2 support.

* Update OpenLDAP to 2.4.50 (for new pw-argon2 password module).

* Build OpenLDAP pw-argon2 module to support the Argon2 key derivation function.

See https://en.wikipedia.org/wiki/Argon2 for more information, and
contrib/slapd-modules/passwd/argon2/README for OpenLDAP specific notes.

Requires OpenLDAP >= 2.4.50 and libsodium >= 1.0.9.

olcPasswordHash can be set to {ARGON2} (from current {SSHA512}) to use argon2
password hashes by default.

* Update for OpenLDAP 2.4.56

* This bit was already there.

* 2.4.56

* Fix compilation error 2.4.56

* Fix compilation

* Upgrade openldap-2.4.56.

* Openldap upgraded to 2.4.59

* Require libsodium >= 1.0.18

* The argon2 module is now part of OpenLDAP 2.5, no longer a contrib module.

* The argon2 module is now part of OpenLDAP 2.5, no longer a contrib module.
debian version not tested.

Co-authored-by: Quanah Gibson-Mount <quanah@symas.com>
Co-authored-by: Prashantsurana <prashant.surana@synacor.com>
Co-authored-by: Prashant Surana <p.k.surana@gmail.com>
Co-authored-by: Umashankar Avagadda <umagmrit@gmail.com>
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.

5 participants