feat: encrypt plugin secrets at rest (#1639)#3524
feat: encrypt plugin secrets at rest (#1639)#3524Abhishek9639 wants to merge 5 commits intointelowlproject:developfrom
Conversation
|
Greetings @mlodic, DB Proof- Secrets Are Encrypted at RestSecret configs in DB: 2 param=url_key_name my.pr.video.mp4 |
|
this is a quite critical change, I'll need time to review it properly |
|
Thank you @mlodic, |
|
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
|
Greetings @mlodic, |
|
I'll review it after the release and eventually include in the next major. I've added the tag to keep it open |
|
Ok @mlodic, |
Closes #1639
Description
Plugin secrets (API keys, tokens, passwords) stored in
PluginConfig.valuewere previously saved as plaintext in the database. This PR adds Fernet symmetric encryption so that secrets are encrypted at rest, preventing data leakage if the database is compromised.Type of change
PLUGIN_CONFIG_FERNET_KEYderived fromPLUGIN_CONFIG_SECRET_KEYenv var (falls back toSECRET_KEY).Plugin.config()to decrypt secrets at runtime before plugin use.cryptography==46.0.0.How it works
startswith("gAAAAA")guard prevents double-encryption.Plugin.config()detects encrypted values and decrypts them before passing to the plugin.Testing
PluginConfigTestCasetests pass (no regressions).gAAAAA...tokens in DB.Checklist
develop.