Closed
Bug 1199179
Opened 9 years ago
Closed 9 years ago
Heroku is using a default of "my-secret-key" for Django's SECRET_KEY
Categories
(Tree Management :: Treeherder: Infrastructure, defect, P1)
Tree Management
Treeherder: Infrastructure
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
References
Details
Attachments
(1 file)
The current Heroku project doesn't define TREEHERDER_DJANGO_SECRET_KEY in the environment, and if none is specified, we fall back to a hardcoded string:
https://github.com/mozilla/treeherder/blob/5c085724b32b89e49a7af3e5a46670a70e2f41dd/treeherder/settings/base.py#L39
SECRET_KEY = os.environ.get("TREEHERDER_DJANGO_SECRET_KEY", "my-secret-key")
We should:
1) Set TREEHERDER_DJANGO_SECRET_KEY on Heroku
2) Make sure Travis/Vagrant set a key, so the fallback isn't required
3) Remove the fallback, so a missing key will result in an error
Assignee | ||
Comment 1•9 years ago
|
||
TREEHERDER_DJANGO_SECRET_KEY has now been set on Heroku, using Django's startproject command template's SECRET key generation for inspiration as to complexity:
https://github.com/django/django/blob/1.8.4/django/core/management/commands/startproject.py#L29-L31
Assignee | ||
Comment 2•9 years ago
|
||
Opening bug now Heroku is using the new key.
Group: mozilla-employee-confidential
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8653437 -
Flags: review?(cdawson)
Assignee | ||
Updated•9 years ago
|
Summary: Heroku is using the default hardcoded Django SECRET_KEY → Heroku is using a default of "my-secret-key" for Django's SECRET_KEY
Updated•9 years ago
|
Attachment #8653437 -
Flags: review?(cdawson) → review+
Comment 4•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/ad3dc73715b844039fbbb03976029a6ec01685e1
Bug 1199179 - Remove default Django SECRET_KEY
Previously if TREEHERDER_DJANGO_SECRET_KEY was not set, we'd silently
fall back to a default value for SECRET_KEY, meaning we wouldn't realise
we were using an insecure key on a live deployment instance.
With this change, TREEHERDER_DJANGO_SECRET_KEY being missing from the
environment is fatal, resulting in:
"ImproperlyConfigured: The SECRET_KEY setting must not be empty."
Assignee | ||
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•