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

[SPIKE] Add Nginx configuration - increase security and performance #1544

Closed
9 tasks done
raftmsohani opened this issue Jan 14, 2022 · 7 comments · Fixed by #2449
Closed
9 tasks done

[SPIKE] Add Nginx configuration - increase security and performance #1544

raftmsohani opened this issue Jan 14, 2022 · 7 comments · Fixed by #2449
Assignees

Comments

@raftmsohani
Copy link

raftmsohani commented Jan 14, 2022

Description:
Nginx is an HTTP server and reverse proxy. Currently, the backend (Django) is NOT behind a proxy server. This can cause security and/or performance issues for the application. The intention behind this ticket is to add proxy server (Nginx) in front of Gunicorn.
The proxy server should forward headers, handle static files, rate limit requests, etc.

Note: This is in conjunction with ticket #1543.

Acceptance Criteria:

  • Request header are successfully being forwarded to Gunicorn and Django
  • Requests from clients are rate limited
  • Static files are cached
  • Testing Checklist has run and all tests pass
  • README is updated, if necessary

Tasks:

Notes:

  • The configuration has to be revisited at deployment

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

Open Questions:
Please include any questions or decisions that must be made before beginning work or to confidently call this issue complete

TODOs:

  • Remove unused CSP vars in settings
  • Investigate and remove unused middleware logic
  • Must have: Add URLs to backend proxy. Currently only /v1 is added but we need to add any URL schema such as /admin. Also need to add a note to url.py file for future url schemas
  • Remove cloud.gov route to the backend.
  • Remove "corsheaders" package.
  • Must have: add new deployment logic for Nginx, the new network, etc
  • Nice to have: Add authentication to Nginx for backend API, so that the URL is not directly reachable without authentication. This need further investigation. One idea is only /auth is reachable and after user is authenticated, then Nginx allows other URLs. This need token authentication between frontend/backend and Nginx
@riatzukiza
Copy link

riatzukiza commented Jan 18, 2022

We don't use the docker compose for deployments, we are using cloud foundry buildpacks

@riatzukiza
Copy link

Theres a history behind the decision to use the buildpacks over a docker file that happened well before the current team was in place. The python build pack is fed ramped, if we used a docker container, or if we changed the start commands as the stack overflow link I posted above is suggesting, it would complicate the approval process. This should considered very carefully.

@valcollignon
Copy link

Tasks need to be revised, per backlog refinement 1.18.22. CC: @riatzukiza @abottoms-coder @raftmsohani

@andrew-jameson
Copy link
Collaborator

andrew-jameson commented Aug 15, 2022

A little bit of scope creep, would like to implement a IP block list because of the recent harassment we received from China/Nepal in prod. That could be it's own ticket, but wanted to discuss it for this as well.

As a small aside, if you can get a inclusive list of US-only based IP addresses for prep work for implementing this in production, that'd be great.

@raftmsohani
Copy link
Author

@raftmsohani
Copy link
Author

This issue is now resolved by : #2449

@Smithh-Co Smithh-Co linked a pull request Mar 24, 2023 that will close this issue
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants