Skip to content
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

Introduce USE_PROXY_SSL_HEADER environment variable #1090

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

abhinavmsra
Copy link
Contributor

Summary

This PR introduces USE_PROXY_SSL_HEADER environment variable to the project.

When set to true, this variable enables the use of the HTTP_X_FORWARDED_PROTO header for secure request detection in case the application is behind a proxy. This helps control Django's is_secure() method behavior, in scenarios where SSL termination occurs at the proxy level.

Changes:

  • added USE_PROXY_SSL_HEADER to the .dev.env file with documentation.
  • update settings.py file to conditionally set SECURE_PROXY_SSL_HEADER settings.

These changes are backward compatible and should not affect existing deployments unless the environment variable is explicitly set.

Links

@abhinavmsra abhinavmsra requested a review from a team as a code owner April 2, 2024 17:00
Copy link

github-actions bot commented Apr 2, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@abhinavmsra
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@abhinavmsra
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Apr 2, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8526621418

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.891%

Totals Coverage Status
Change from base Build 8513833425: 0.0%
Covered Lines: 4597
Relevant Lines: 4602

💛 - Coveralls

@fmrsabino fmrsabino added the in review Someone is reviewing this Pull Request label Apr 4, 2024
Copy link
Collaborator

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small comment but looks good! Thanks for the contribution.

.dev.env Show resolved Hide resolved
@fmrsabino fmrsabino removed the in review Someone is reviewing this Pull Request label Apr 4, 2024
Copy link
Collaborator

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! 👏

@fmrsabino fmrsabino merged commit 0469ba8 into safe-global:main Apr 5, 2024
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2024
@abhinavmsra abhinavmsra deleted the fix/insecure-behind-proxy branch April 5, 2024 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants