A Better Way to Manage the Rails Secret Token
daniel.fone.net.nz
A Better Way to Manage the Rails Secret Token
1–10 of 60 posts
Re: A Better Way to Manage the Rails Secret Token
#2Re: A Better Way to Manage the Rails Secret Token
#3Re: A Better Way to Manage the Rails Secret Token
#4Re: A Better Way to Manage the Rails Secret Token
#5Re: A Better Way to Manage the Rails Secret Token
#6I hate code like this that is explicitly aware of the environment. The code says what it will do in an environment, rather than the environment saying what the code should do in it.
Re: A Better Way to Manage the Rails Secret Token
#7Unless you're grabbing that key out of "secure memory", a HSM or a TPM then its not really particularly secure.
Re: A Better Way to Manage the Rails Secret Token
#8I'm not sure I understand what dotenv does (or why you would need it to do it).
$ SECRET_TOKEN=abcdef SOME_OTHER_VAR=hello rails s
or pollute your .profile with a bunch of app-specific variables.
You don't need it to do it; it just makes it easier.
Re: A Better Way to Manage the Rails Secret Token
#9Worse. Knowing the secret token allows an attacker to trivially execute code in your application.
Don't ever let your secret token become public knowledge, and if it does, you need to change it straight away.