zombiezen / sandpass

Password manager for Sandstorm
https://apps.sandstorm.io/app/rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h
Apache License 2.0
25 stars 7 forks source link

Session expire too quickly, persist sessions #31

Closed zombiezen closed 5 years ago

zombiezen commented 5 years ago

I originally designed the sessions to last for 30 minutes or so, but Sandstorm has gotten more aggressive about shutting down grains. Fixing this requires some level of session persistence. My plan is to persist session encryption keys on the server, then store encrypted cookies with the database's computed key on the client. That way, the database's key is never persisted anywhere in the clear, and the persisted server keys can be rotated regularly. A compromise of the server keys is only valuable if you also compromise a client session token encrypted with the same key, but even then, the attacker can't gain the master password, just the computed key. The user could cycle their keyfile and still be fine.