Automatic SECURE_KEY generation
The SECURE_KEY of every Django installation should be set to a unique value upon deployment. Currently, it is the system administrators responsibility to change this to a secure (i.e. unique) value. He has several ways to achieve this:
- Do it manually (current state)
- Use a (Linux) distribution-
- Deploy via crowbar with a modified dashboard barclamp that generates the key
The first option is tedious and error-prone (and easily forgotten). The second option fails if the package is part of a pre-generated appliance (thus installed only once but deployed multiple times) and the latter is beyond our control. Instead, we should allow dashboard instances to generate the secret key automatically once upon first start. However, this can be rather tricky, as the typical Apache+
https:/
It has the advantage that SECRET_KEY doesn't have to be part of local_settings.py anymore and thus is one thing less one needs to care for. It has an additional dependency on the 'lockfile' Python module, but I don't see this as an issue, as it is also pulled in by nova (as a transitive dependency of python-daemon).
Blueprint information
- Status:
- Complete
- Approver:
- Gabriel Hurley
- Priority:
- Medium
- Drafter:
- Gabriel Hurley
- Direction:
- Approved
- Assignee:
- Sascha Peilicke
- Definition:
- Approved
- Series goal:
- Accepted for folsom
- Implementation:
- Implemented
- Milestone target:
- 2012.2
- Started by
- Gabriel Hurley
- Completed by
- Gabriel Hurley
Related branches
Related bugs
Sprints
Whiteboard
After discussing this with both the Horizon core team and Django's security czar/core committer Paul McMillan, we've decided the best way to proceed with this is as follows:
* Remove the default SECRET_KEY so it cannot be shared causing security problems.
* For development, add a few lines to auto-generate a SECRET_KEY if one isn't present.
* For production, document that a SECRET_KEY is required, how to generate one, etc.
* Work with the distros to make sure they properly generate a unique SECRET_KEY for each install.
Just for reference: http://<email address hidden>
Gerrit topic: https:/
Addressed by: https:/
Provide utilities to automate secure secret key generation