-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rails 5.1.0.beta1: Shouldn't be the line config.read_encrypted_secrets = true in all environments? #28193
Comments
config.read_encrypted_secrets = true
in all environments?
I'm not sure how helpful that would be. It seems to me, if you're going to require the decryption keys to be present on any machine that wants to boot the application, even in development or test, you might as well just git-ignore In my mind, the value of the encryption is that you can keep the secrets with the application while only needing to distribute the keys to the subset of deployments that actually need the "secret secrets".
Can you elaborate on your intended use case, perhaps? If every clone of the repository needs the keys in order to be useful, which dangers/attacks are being thwarted by the encryption? |
Currently I have an application where I'm authenticating a user with Facebook. Every environment has it's own Facebook App Secret (development / staging / production) since OAuth redirect URLs must match the specific servers. I thought that Sure I could add all of this to With the new mechanism I just need to distribute the key. |
Alternatively we could adapt the documentation to state:
But please tell me if I got the whole thing wrong :-) |
Right.. but either way, you're distributing a single file / string. What makes this string better than the other one? Personally, I'd put the production and staging keys in |
If I can choose between sharing string or a yml file I'd prefer the string - but I guess I'm nit-picking here so I'll elaborate the full process: I was trying out the new mechanism (out of curiosity) and in development the keys didn't show up until I've added the line from above to the development.rb. What do you think about adopting the documentation to let the user decide in which environment he wants to use the mechanism? Or do you even discourage people to use |
We're only going to recommend it for production secrets, yes. Feel free to try your hand at a doc PR that elaborates on the |
Ok cool. Could you point me to the source of the docs and I'll write up my findings. |
@sebastiandeutsch took a stab at it in b16dcc8 since we're (hopefully) close to another release. Thanks! |
Mostly just that it's there. Closes #28193.
Sweet :-) |
Steps to reproduce
When I run
bin/rails secrets:setup
it putsconfig.read_encrypted_secrets = true
in my production environment (or it was there before) - but to use it as desired I need to putconfig.read_encrypted_secrets = true
in all my environments.Expected behavior
I don't expect
Rails.application.secrets
to be missing mysecrets.yml.enc
in development.Actual behavior
Well... the keys are missing.
System configuration
The text was updated successfully, but these errors were encountered: