oscerd opened a new pull request, #25826: URL: https://github.com/apache/camel/pull/25826
Fixes [CAMEL-24447](https://issues.apache.org/jira/browse/CAMEL-24447). 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) <[email protected]> Signed-off-by: Andrea Cosentino <[email protected]> \n## Verification\n\n3 files changed, including 1 test file(s). Module build with \`-am\` is green on current main, no generated-file drift. Verified against the pre-fix code when the change was written. _Claude Code on behalf of oscerd_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
