Skip to content

introduce profile setting to gunicorn #3262

@benoitc

Description

@benoitc

It's unfortunate that people don't understand when talk about security in Gunicorn. When Gunicorn is used as a WSGI server it shoudl comply as much as possible with the specification. (Even it's slightly relaxed for streaming content as of today). For example some environ variables are required: https://peps.python.org/pep-3333/#environ-variables and for Error handling in general the applications should trap their own internal error : https://peps.python.org/pep-3333/#error-handling

As for gunicorn I think that we should provide 2 modes:

  1. is running behind a proxy/HTTP server . In this case some secuirtiy could be relaxed and CGI variables, probably Forwatd shuoudl be passed and secured from this server . This is the advised way until now.
  2. gunicorn acting itself as main server. In such case we should ensure only Gunicorn and system env can set this variables .

A simple --profile setting set as server or gateway could enforce some rules and options. ie. no CGI-VARIABLES should be accepted when it's come from HTTP in server profile. These variables can only be set using OS env or configuration in such case. In gateway mode we should probably accept them transparently and let the security beeing handled by the server on top.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions