#48: Use session instead of cookie plugin to store PAS authentication
Use SessionCrumblers session authentication plugin to get secure session based authentication without base64 password cookies.
- Proposed by
- Simon Eisenmann
- Seconded by
- Alexander Limi
- Proposal type
- Architecture
- Repository branch
- plip48-bundle
- State
- rejected
Motivation
Currently PlonePAS uses either basic or cookie auth to store the authentication credentials. PluggableAuthenticationService comes with a session auth plugin which stores the credentials inside the session.
Why?: Cookies are used to remember the authentication credentials in Plone. On login PAS simply stores zopes basic auth into a cookie. This means that the users login credentials (userid + password) is basically transmitted in plain text on every single request. Also the login data is stored on the local harddisk.
In continuation of the CookieCrumbler which has been replaced by PAS -> cookie plugin Plone should ship a similar plugin like implemented for Plone 2 with the SessionCrumbler product.
By replacing cookie auth with session auth we get a more secure implementation, cause the password is only transmitted once while the login itself. The password is stored inside the users session which lives in the servers memory. The only thing transmitted along with every request is the session id inside a cookie.
As sessions are not really meant for storing security sensitive information, The session auth plugin should implement a secure container class which prevents access to login credentials from untrusted code. This does not make it secure if you are strict, but it makes it a lot more secure than the current cookie solution. This secure container is not part of the default session plugin of PAS at the moment.Proposal
- Replace credentials_cookie_auth with credentials_session_auth to get rid of plain text password transfer on any request.
- Build a session_auth plugin similar into SessionCrumbler.
- Use this plugin on portal creation (PlonePAS.Extensions.Install)
Implementation
- SessionCrumbler contains a PAS plugin for session auth. (http://longsleep.org/projects/sessioncrumbler)
- PlonePAS should use this plugin for authentication.
Risks
- Sessions require memory
- The Session storage (zopes TemporaryStorage) has not been very "stable" with lots of paralel requests in the past.
- When using multiple ZEO clients for a single portal, you need either share the session storage between all clients or keep a mapping which makes sure one session always ends up at the same ZEO client (loadbalancers can do that easily).
- Default Zope session limit is set to 1000. This means without reconfiguration we are limited to 1000 parallel logged in users.
- Still requires a cookie (for session id).
- Sessions do have a timeout. This means if the user does not do anything, the login session will expire. This is a major functionality change.
- Sessions are gone on ZEO client restarts. This means logins are lost when the instance is restared. This is another major change.
Progress log
- Implemented PAS plugin inside the SessionCrumbler product.
- Modified PlonePAS installer to use SessionCrumblers plugin.
Scalability