-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the config decryption key to be retrieved by a user-provided function #104
Comments
@dannylevenson - what do you think? |
This definitely sounds better than storing or passing the key everywhere it is needed. The key could potentially be retrieved from secure storage (i.e.: SSM) in the callback, which I'm sure you have in mind. That leads me to wonder, why not retrieve the secrets themselves from secure storage? It's appealing to store secrets all in one place and use policies to govern access. I guess I'm feeling like secrets are maybe outside the scope of BlueOak. In any case, it's already a feature, so it makes sense to introduce a more secure way to use it. I don't fully understand everything at work here, like the clustering process, so I might be way off base :) |
@adamrbennett - yes, there are definitely other options for handling secrets. Regarding clustering, it currently happens by setting an environment variable and forking (cluster.fork) the running process. I'm thinking to do the fork, but have each process look up the key itself. This duplicates the work of getting the key and decrypting the secrets in the config, but keeps the secret in the running processes, only when they need them to decrypt. |
Currently the
config
service supports 3 ways to provide a decryption key:security.key
(don't abuse this by checking that into your source control! - have a deployment script write a fileconfig/security.json
with the key in it)decryptionKey
Writing a file to disk, or setting an environment variable with the decryption key, leaves that key available to several exploits to use.
Let's add support for retrieving the key from a callback function the developer can write to get the key from whatever secure storage they choose to implement.
Also, then, since in clustered mode the decryption key is passed to each worker as an environment variable, we should look at alternatives, for all cases, to that method.
Further, since the decryption key is exported from the config service (and kept in memory), we should look for an alternative to that too. (NOTE: even though this will change the exports of the config service, it is not a documented export and should not be considered a breaking change.)
The text was updated successfully, but these errors were encountered: