Repository navigation
dkim: enforce 0600 on private keys at every start - #13
Merged
Merged
Conversation
opendkim refuses a key that group/others can read ("key data is not
secure") and tempfails every message of that domain with 4.7.1. The keys
live on the /etc/postfix/additional volume, so their mode is whatever the
host left — found 0644 keys on two production gateways, which delayed all
outgoing mail of those domains until the sender retried via the other MX.
The entrypoint now chmods every opendkim default.private to 0600 on each
start (after init, so freshly generated keys are covered as well).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
opendkim refuses a key that group/others can read (
key data is not secure) and then tempfails every message of that domain (4.7.1 Service unavailable). The keys live on the/etc/postfix/additionalvolume, so their mode is whatever the host left — two production gateways had0644keys, which delayed all outgoing mail of those domains until the sender retried via the other MX.The entrypoint now sets every opendkim
default.privateto0600on each start — after the one-time init, so freshly generated keys are covered, and also on a plaindocker restart(dkim-helper.sh only runs at first init).Tested
./test.shpasses0600after first start, logged (>> DKIM - enforce key permissions+ file name)docker restart→0600again🤖 Generated with Claude Code