[backport camel-4.22.x] CAMEL-24447: camel-pqc - restrict private key file permissions - #25856
Merged
Croway merged 1 commit intoAug 28, 2026
Merged
Conversation
…pache#25826) FileBasedKeyLifecycleManager stores private keys unencrypted, as Base64 PKCS#8 inside a JSON file, and created both the key directory and those files with whatever the process umask allowed. Under the common 022 that is rw-r--r-- and rwxr-xr-x, so every account on the host could read them. Create the key directory as rwx------ and each <keyId>.private.json as rw-------, where the file system supports POSIX permissions, falling back to the equivalent owner-only java.io.File flags elsewhere. The file is restricted before its content is written, so the key is never briefly readable while being written. A private key file left behind by an earlier version is tightened the next time that key is stored: storeKey opens it with TRUNCATE_EXISTING rather than recreating it, so it would otherwise keep the permissions it was created with. Public keys and metadata are left alone - they are not secret, and restricting them would break readers for no benefit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all testedMaveniverse Scalpel detected 38 affected modules (current approach: 9).
|
Croway
approved these changes
Aug 28, 2026
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.
Backport of #25826
Cherry-pick of #25826 onto
camel-4.22.x.Original PR: #25826
Original author: @oscerd
Resolution: the 4.23 upgrade-guide entry is dropped, since the guides for every release line live on
main.Verified: module builds green on
camel-4.22.xwith no generated-file drift.Claude Code on behalf of oscerd