aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-12-21 12:50:09 -0800
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-12-21 12:50:09 -0800
commit59ea907a30438a3aa458ef18f0ccb6ceadb8322d (patch)
treeea714fcfaeabe79619235c8f38fa0e70a86da26b /guides
parentecc77515754b15e5a2d794832ec4a5286cabdfe5 (diff)
parente176580e078b30916c7f3c09c596f2d4d9f49517 (diff)
downloadrails-59ea907a30438a3aa458ef18f0ccb6ceadb8322d.tar.gz
rails-59ea907a30438a3aa458ef18f0ccb6ceadb8322d.tar.bz2
rails-59ea907a30438a3aa458ef18f0ccb6ceadb8322d.zip
Merge pull request #8584 from garysweaver/security_guide_update
Updated security guide to reference secret_key_base instead of secret_token
Diffstat (limited to 'guides')
-rw-r--r--guides/source/security.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/security.md b/guides/source/security.md
index 53835781f4..0b0cfe69c4 100644
--- a/guides/source/security.md
+++ b/guides/source/security.md
@@ -96,11 +96,11 @@ Rails 2 introduced a new default session storage, CookieStore. CookieStore saves
That means the security of this storage depends on this secret (and on the digest algorithm, which defaults to SHA512, which has not been compromised, yet). So _don't use a trivial secret, i.e. a word from a dictionary, or one which is shorter than 30 characters_.
-Newly generated applications get their `config.secret_key_base` (or in `environment.rb` in some past versions) initialized to a random key in `config/initializers/secret_token.rb`, e.g.:
+`config.secret_key_base` is used for specifying a key which allows sessions for the application to be verified against a known secure key to prevent tampering. Applications get `config.secret_key_base` initialized to a random key in `config/initializers/secret_token.rb`, e.g.:
- Posts::Application.config.secret_token = 'dkfj3927dkc7djdh36rkckdfzsg...'
+ YourApp::Application.config.secret_key_base = '49d3f3de9ed86c74b94ad6bd0...'
-There are, however, derivatives of CookieStore which encrypt the session hash, so the client cannot see it.
+Older versions of Rails use CookieStore, which uses `secret_token` instead of `secret_key_base` that is used by EncryptedCookieStore. Read the upgrade documentation for more information.
If you have received an application where the secret was exposed (e.g. an application whose source was shared), strongly consider changing the secret.