Securing db_clients and redis_clients Parameters via Encrypted config.json #2338
Replies: 4 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
/// Load the configuration from a Json::Value Object.
/**
* @param data Json::Value Object containing the configuration.
* @note Please refer to the configuration file for the content of the json
* object.
*/
virtual HttpAppFramework &loadConfigJson(const Json::Value &data) noexcept(
false) = 0; |
Beta Was this translation helpful? Give feedback.
-
Hi @an-tao, It seems you imply me to override all functions of HttpAppFramework like HttpAppFrameworkImpl class. Do you have other better idea? |
Beta Was this translation helpful? Give feedback.
-
I don't think you need to override all the functions. Just decrypt the configuration file into a plaintext string, convert it into a JSON object, and then call the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Drogon team,
In the website I'm currently developing with Drogon, I'm aiming to enhance security by encrypting the contents of
config.json
, particularly the parameters fordb_clients
andredis_clients
. My goal is to decrypt the file at runtime and pass the decrypted content as input toloadConfigFile()
so that the file remains unreadable in its stored form.I’ve successfully implemented this approach for
custom_config
. However, I’ve noticed thatdb_clients
andredis_clients
appear to be handled differently, as they are set within theload()
function insrc/ConfigLoader.cc
:Could you please advise on the best way to securely load encrypted values for
db_clients
andredis_clients
, or whether there's a recommended hook or method to inject these values after decryption? Alternatively, could you help create a new function to support this use case—specifically, one that accepts a decrypted JSON object and applies the same configuration logic asload()
?Thank you in advance for your support.
Best regards,
Eric
Beta Was this translation helpful? Give feedback.
All reactions