🔒 [security] encrypt token cache and configuration at rest#105
Conversation
Implemented encryption for `config.json` and `token-cache.json` using `aes-256-ctr` with a key derived from system information. This provides defense in depth for sensitive credentials like authentication tokens and client secrets. Added backward compatibility to read existing plaintext files and updated tests to handle the new encrypted format. Co-authored-by: cmuench <211294+cmuench@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses a security vulnerability where authentication tokens and secrets were stored in plaintext JSON files.
🎯 What: Introduced encryption at rest for
⚠️ Risk: Storing secrets in plaintext on disk exposes them to any local user or process with read access, which is especially risky on multi-tenant developer workstations.
config.jsonandtoken-cache.json.🛡️ Solution:
cryptomodule withaes-256-ctr.os.hostname()andos.userInfo().username.saveConfig,loadConfig,saveTokenCache, andloadTokenCacheinlib/config.jsto handle encrypted data.tests/config.test.jsto account for the new encryption layer.tests/token_encryption_repro.test.jsto verify encryption works as expected.PR created automatically by Jules for task 7106440122432922954 started by @cmuench