-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: Enable DH parameters (ffdhe4096) by default #2192
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
fix: Enable DH parameters (ffdhe4096) by default #2192
Conversation
This file only exists at the location to be copied to separate `postfix` and `dovecot` locations. `/etc/postfix/shared` seems like an inappropriate location to have been using.
These are effectively the same, did a diff comparison: - Identified minor inconsistencies and in `_notify` output. - Parameterized service names and paths. - Added some comments to better grok the flow. Next these two methods can be collapsed into a single one with input args to make it DRY.
This only needs to modify the `DH_CUSTOM` path var. More DRY, the conditional branch for `ONE_DIR=0` (else), is kept and shifts it's indentation one level to the left. I don't see any value in checking the alternative service for dh params file to copy over, so that's now dropped too.
Another conditional check is dropped and the default fallback message for existing DH params file is no longer relevant. Improved the remaining `_notify` messages. Collapsing the warning into a single logged message also seemed relevant. Custom provided DH params now use `cp -f` to overwrite the existing default `ffdhe4096.pem` used.
- Normalize whitespace (had mixed indentation of spaces and tabs, and mixed indentation width of 2 and 4 spaces). - Improved formatting of docker args. - (default test file) Swapped order of ONE_DIR bool definitions, and `PRIVATE_CONFIG` var duplicated with ONE_DIR suffix instead of recycling the var. - Updated the grep tests checking docker logs for warning message.
This feature was introduced by the PR: docker-mailserver#1463 There is no official documented support for custom DH parameters. As no guarantee is provided, this is considered an internal change, not a breaking one. There is no apparent need for special handling with `ONE_DIR=1`.
Now DRY and ready to merge the other two DH param tests into.
|
I'd love to see a bit of documentation on this :) Other than that, LGTM 👍🏼 |
Sure, I'll sort that out after I figure out the other bullseye failure with TLS tests. |
|
Test failure can be ignored, fixed by the v10.2 release Lint errors to address:
These 3 ShellCheck failures seem like they should be ignored?
|
|
LGTM. I addressed the linting problems with comments above. Note that GitHub now has a "batch" feature with which you can commit multiple suggestions at once. |
|
Very nice simplification of our DH parameter stuff! I was not able to find anything to complain 😉 Just waiting till Georgs suggestion are applied, to approve this PR 👍 |
wernerfred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻 well done
Co-authored-by: Georg Lauterbach <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to apply the other lint corrections (same lint issues raised on similar lines). Then docs will follow.
Additionally updates the acme RFC URL to what it now redirects to.
1742ccf to
ca49f9d
Compare
|
Documentation preview for this PR is ready! 🎉 Built with commit: bbedf5f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
The failing action is due to missing setup.sh changes right? https://github.com/docker-mailserver/docker-mailserver/pull/2192/checks?check_run_id=3604545578#step:8:331
Correct :) Almost got another PR ready that is intended for 10.2 release. So that issue should be taken care of soon enough. |
Description
Summary
setup-stack.sh.doveadmin newer versions of Dovecot (community/bullseye) seems to validate Dovecot configs and will fail ifsetup-stack.shis not run first (eg when usingsetup.shand no existing running container).Problem
setup-stack.shcurrently copies theffdhe4096.pemDH param file when none exists and no custom DH params file is provided by a user. This only applies when initializing a container instance via the default command however..When you provide another command, such as the
setup.shmanagement ones, and a container instance needs to be started instead of using an existing one, this will not runsetup-stack.shand thus default DH params are not guaranteed.With our current Dovecot in
buster-slimimages, this has gone unnoticed as no error is raised. With the community edition of Dovecot that some users replace our shipped version with, or with the newer Dovecot in thebullseye-slimimage we want to upgrade to, it seems thatdoveadmwill validate the10-ssl.confconfig, which involvesssl_dhpointing to a file that doesn't exist.doveadmthrows an error and refuses to run as a result, even though this file is unnecessary.Solution
As the cause has been identified, this PR resolves the issue by copying the
ffdhe4096.pemto Dovecot and Postfix locations during a build via the Dockerfile.The DH param handling in
setup-stack.shhas been heavily refactored to remove no longer relevant logic, and make it easier to maintain. Commit history of this PR has carefully iterated on this process with relevant commit messages for anyone interested in following the changes made in an easier to grok manner.Likewise, the related tests were updated and I've opted to combine them all into a single new refactored DRY variant. As
ONE_DIRhandling was removed from the relevantsetup-stack.shfunction, the test could also drop testing both states if desired. There is minimal increase in test time from theONE_DIRhandling, so I've left it as-is for now.Note: While this resolves a failure with
bullseye-slimimage, the TLS cipher suite test continues to fail onbullseye-slimfor other reasons AFAIK (presently investigating).I do not consider this a breaking change despite some of the changes. The original PR that added the feature added no documentation, and I did several searches through the git repo files to double check. If we don't advertise official support for providing custom DH params, this seems fine.
AFAIK most/all users would have just been using the default supplied DH params (
ffdhe4096.pem). Custom DH params is still supported and that has only changed in removing the variantONE_DIR=1(mail-state/lib-shared/) directory. TheONE_DIR=0approach (add custom file to/tmp/docker-mailserver/dhparams.pem) is now the the approach regardles ofONE_DIRsetting.I've not yet added documentation of the feature (eg providing custom params, what are the default params). If you would like that as well with this PR let me know.
Type of change
Checklist:
docs/)