summaryrefslogtreecommitdiff
path: root/docs/narr/security.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-10-20 16:15:34 -0400
committerChris McDonough <chrism@plope.com>2013-10-20 16:15:34 -0400
commit2a6e6b3776b07589f8bbaaf4c72419f2bdf5e218 (patch)
tree5074ba1d0d378b91b640e234c9c9267fcbe06015 /docs/narr/security.rst
parent6c98b17ed9aadbe485c6473c3f76e1b2b529dc78 (diff)
parent0264cc0c3d4ca091d4d5c8bd0c2fda38a3f8a0c7 (diff)
downloadpyramid-2a6e6b3776b07589f8bbaaf4c72419f2bdf5e218.tar.gz
pyramid-2a6e6b3776b07589f8bbaaf4c72419f2bdf5e218.tar.bz2
pyramid-2a6e6b3776b07589f8bbaaf4c72419f2bdf5e218.zip
Merge branch 'master' into fix.basic-authentication-encodings
Diffstat (limited to 'docs/narr/security.rst')
-rw-r--r--docs/narr/security.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/narr/security.rst b/docs/narr/security.rst
index 6517fedf8..e85ed823a 100644
--- a/docs/narr/security.rst
+++ b/docs/narr/security.rst
@@ -669,3 +669,31 @@ following interface:
After you do so, you can pass an instance of such a class into the
:class:`~pyramid.config.Configurator.set_authorization_policy` method at
configuration time to use it.
+
+.. _admonishment_against_secret_sharing:
+
+Admonishment Against Secret-Sharing
+-----------------------------------
+
+A "secret" is required by various components of Pyramid. For example, the
+:term:`authentication policy` below uses a secret value ``seekrit``::
+
+ authn_policy = AuthTktAuthenticationPolicy('seekrit', hashalg='sha512')
+
+A :term:`session factory` also requires a secret::
+
+ my_session_factory = SignedCookieSessionFactory('itsaseekreet')
+
+It is tempting to use the same secret for multiple Pyramid subsystems. For
+example, you might be tempted to use the value ``seekrit`` as the secret for
+both the authentication policy and the session factory defined above. This is
+a bad idea, because in both cases, these secrets are used to sign the payload
+of the data.
+
+If you use the same secret for two different parts of your application for
+signing purposes, it may allow an attacker to get his chosen plaintext signed,
+which would allow the attacker to control the content of the payload. Re-using
+a secret across two different subsystems might drop the security of signing to
+zero. Keys should not be re-used across different contexts where an attacker
+has the possibility of providing a chosen plaintext.
+