Added following security enhancements:

1) Added ALLOWED_HOSTS list to limit the host address.
  2) Added CSP and HSTS security header.
  3) Hide the webserver/ development framework version.

Fixes #5919
This commit is contained in:
Ganesh Jaybhay
2020-10-20 17:14:45 +05:30
committed by Akshay Joshi
parent 3413a42af4
commit 08c4deba5a
11 changed files with 148 additions and 11 deletions

View File

@@ -311,7 +311,11 @@ class ManagedSessionInterface(SessionInterface):
response.set_cookie(
app.session_cookie_name,
'%s!%s' % (session.sid, session.hmac_digest),
expires=cookie_exp, httponly=True, domain=domain
expires=cookie_exp,
secure=config.SESSION_COOKIE_SECURE,
httponly=config.SESSION_COOKIE_HTTPONLY,
samesite=config.SESSION_COOKIE_SAMESITE,
domain=domain
)