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

Add Gunicorn settings to correctly receive header #1543

Closed
6 tasks
raftmsohani opened this issue Jan 14, 2022 · 0 comments
Closed
6 tasks

Add Gunicorn settings to correctly receive header #1543

raftmsohani opened this issue Jan 14, 2022 · 0 comments
Assignees
Labels
backend dev devops DX Developer Experience Refined Ticket has been refined at the backlog refinement

Comments

@raftmsohani
Copy link

raftmsohani commented Jan 14, 2022

Description:
Gunicorn is python package that serves Django application as WSGI HTTP server. The existing configuration for Gunicorn is from the cmd line:
gunicorn tdpservice.wsgi:application --bind 0.0.0.0:8080 --timeout 10 --workers 3 --log-file=- --log-level $LOGGING_LEVEL
Due to security compliance issues with RFC3875 Gunicorn shows REMOTE_ADDR as IP address and additionally drops any header that is coming from an untrusted proxy. We have to add Nginx as a trusted source for forwarded headers and additionally change setting to receive all headers securely (should we decide to use them in the logic).
This issue is ultimately related to Nginx (issue #1544 ) settings to have the headers being forwarded to Gunicorn.

Acceptance Criteria:

  • Django receives client http headers
  • Django receives custom http headers
  • Testing Checklist has been run and all tests pass
  • README is updated, if necessary

Tasks:

  • add --forwarded-allow-ips="*" to Gunicorn start cmd
  • Run Testing Checklist and confirm all tests pass

Notes:

  • During deployment, Nginx's IP address should replace '*' to add more security

Supporting Documentation:
Please include any relevant log snippets/files/screen shots

Open Questions:

  • Should we use socket? (to ncrease performance)
@raftmsohani raftmsohani changed the title Add Gunicorn settings Add Gunicorn settings to correctly receive header Jan 14, 2022
@stevenino stevenino added DX Developer Experience Refined Ticket has been refined at the backlog refinement devops labels Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dev devops DX Developer Experience Refined Ticket has been refined at the backlog refinement
Projects
None yet
Development

No branches or pull requests

3 participants