fix(security): Secure ALLOWED_HOSTS configuration. Closes #925#950
Merged
regulartim merged 3 commits intointelowlproject:developfrom Mar 5, 2026
Merged
Conversation
…uration via DJANGO_ALLOWED_HOSTS environment variable.
Contributor
Author
|
@regulartim please review the PR |
regulartim
requested changes
Mar 5, 2026
Collaborator
regulartim
left a comment
There was a problem hiding this comment.
Looks good, all in all! 👍
…nvironment variable and introduce a system check for wildcard usage.
regulartim
approved these changes
Mar 5, 2026
Collaborator
regulartim
left a comment
There was a problem hiding this comment.
Hey @chauhan-varun ! Looks good, thanks! :)
cclts
pushed a commit
to cclts/GreedyBear
that referenced
this pull request
Mar 11, 2026
…ject#925 (intelowlproject#950) * feat: Add security check for wildcard ALLOWED_HOSTS and enable configuration via DJANGO_ALLOWED_HOSTS environment variable. * style: reformat hint string for ALLOWED_HOSTS wildcard warning. * fix: Allow `ALLOWED_HOSTS` configuration via `DJANGO_ALLOWED_HOSTS` environment variable and introduce a system check for wildcard usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make
ALLOWED_HOSTSconfigurable via theDJANGO_ALLOWED_HOSTSenvironment variable (comma-separated) instead of hardcoding["*"]. Falls back to["*"]for backward compatibility so no existing instance breaks, but logs a WARNING in production (DEBUG=False) when the variable is not set. Also registers a Django System Check (greedybear.W001) that flags the wildcard when runningmanage.py check --deploy.Related issues
Closes #925
Type of change
Screenshots
1. Warning log when
DJANGO_ALLOWED_HOSTSis not set (production mode)2. Django deploy check (
greedybear.W001)3. With
DJANGO_ALLOWED_HOSTSset (no warning)Checklist
Formalities
<feature name>. Closes #999develop.develop.Docs and tests
Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.GUI changes
No GUI changes.