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

Security unit tests #298

Closed
moggers87 opened this Issue Jan 20, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@moggers87
Copy link
Member

moggers87 commented Jan 20, 2018

We currently use Django's check system to test a number of security settings: CSRF protection, HTTPS redirect, etc.

However, these checks are quite brittle: many simply do a check for a specific string in the list of middlewares plus a specific setting.

When using a custom or third party middleware that replaces one of Django's, silencing the check is required. This means no check is being done and can be quite dangerous if the custom middleware is then removed (as happened to us recently)

There are some checks, such as the secret key check that cannot be made into unit tests as they are dependant on where Inboxen is being deployed. Anything that doesn't change based on user configuration should have a test.

@moggers87

This comment has been minimized.

Copy link
Member

moggers87 commented Jan 23, 2018

Checks that should be unit tests:

  • HSTS (not currently set at all, we leave it to the HTTPd config)
  • Secure/Httponly session cookies
  • X-XSS-Protection (see #297)
  • SSL redirect
  • CSRF protection
  • CSRF cookie? (or at least test we don't set it and rely on the session value)
  • X-Frame options
  • nosniff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment