Skip to content

Session secret documentation does not encourage good secret management strategiesย #1187

Closed
@jacksingleton

Description

In the readme and intro documentation, we describe how to set a session secret manually with this code block:

set :session_secret, 'super secret'

We don't mention anywhere that the value should really be pulled in from an environment variable (or possibly config file not checked into the codebase, secret store, etc).

We also don't mention how to securely generate the value.

While ideally all developers would know that this secret shouldn't be checked into code, and should be generated with a CSPRNG, frameworks have an opportunity to promote good security practices. This will simultaneously educate developers and prevent vulnerabilities.

I'd suggest that we:

  1. Show code examples sourcing secrets from environment variables
  2. Add an example of generating a secure random secret

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions