django: Use Argon2 password hash

Passwords will be automatically upgraded for each user on login.

Usernames not yet upgraded are vulnerable to user enumeration attack due to
difference in password check timing.

No need to add build dependency on python3-argon2 because tests use a different
Django configuration which does not use argon2 hash.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-01-13 14:46:15 -05:00
1 parent 039461b846
commit 1faee11d4d
2 files changed
+7

No files matched your search

+1
View File
@@ -79,6 +79,7 @@ Depends:
ppp, ppp,
pppoe, pppoe,
python3-apt, python3-apt,
python3-argon2,
python3-augeas, python3-augeas,
python3-bootstrapform, python3-bootstrapform,
python3-cherrypy3, python3-cherrypy3,
+6
View File
@@ -135,6 +135,12 @@ def init():
'plinth.modules.first_boot.middleware.FirstBootMiddleware', 'plinth.modules.first_boot.middleware.FirstBootMiddleware',
'plinth.middleware.SetupMiddleware', 'plinth.middleware.SetupMiddleware',
), ),
PASSWORD_HASHERS=[
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
],
ROOT_URLCONF='plinth.urls', ROOT_URLCONF='plinth.urls',
SECURE_BROWSER_XSS_FILTER=True, SECURE_BROWSER_XSS_FILTER=True,
SECURE_CONTENT_TYPE_NOSNIFF=True, SECURE_CONTENT_TYPE_NOSNIFF=True,