-
Notifications
You must be signed in to change notification settings - Fork 55
Fail closed when ALLOWED_HOSTS is not set in production #2308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Alberto Vilches (avilches)
wants to merge
19
commits into
main
Choose a base branch
from
security/gateway-allowed-hosts-default
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d0ca7d7
Default ALLOWED_HOSTS to localhost in production
avilches 70c4a20
Default chart allowedHosts to localhost so unset deployments fail closed
avilches 94673dc
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches 75b20b3
Fail closed when ALLOWED_HOSTS is unset in production
avilches 356013d
Add ALLOWED_HOSTS settings regression tests
avilches 3c0f87d
Merge remote-tracking branch 'origin/main' into security/gateway-allo…
avilches c793c08
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches 6c2d090
Merge remote-tracking branch 'origin/main' into security/gateway-allo…
avilches 7c02a6d
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches bc78100
Merge remote-tracking branch 'origin/main' into security/gateway-allo…
avilches 60976ac
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches fcf3a74
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches 6aac0b5
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches edd886b
Merge branch 'main' into security/gateway-allowed-hosts-default
korgan00 dad93e4
Merge remote-tracking branch 'origin/main' into security/gateway-allo…
avilches 7dbee82
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches 5f54f6f
Merge branch 'main' into security/gateway-allowed-hosts-default
ElePT 72e661c
Merge branch 'main' into security/gateway-allowed-hosts-default
avilches 5e4d240
Merge branch 'main' into security/gateway-allowed-hosts-default
korgan00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if
_allowed_hostsis*?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, probably yes 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point, I guess you're suggesting something like this:
Right? so it rejects an explicit * with DEBUG/IS_TEST off, which sounds ok... but this is something different of the main purpose of this PR, which it just fails when ALLOWED_HOSTS is missing in production, not checking the content...
If we want validate the content, forbidding * in production, it's more than just check if _allowed_host is *:
So, I would keep this PR scoped to "fail closed on missing ALLOWED_HOSTS" as it is right now... and handle "reject a * value in production" PR as a follow-up, because it will require configuring the production/staging environment with the right value first before rejecting the *...