项目作者: springload

项目描述 :
法律的Wagtail部门 - 在Wagtail网站上执行安全协议
高级语言: Python
项目地址: git://github.com/springload/wagtailenforcer.git
创建时间: 2015-06-05T03:50:46Z
项目社区:https://github.com/springload/wagtailenforcer

开源协议:

下载


wagtailenforcer PyPI

WagtailEnforcer, the strong arm of the law.

If you need to enforce security protocols on your Wagtail site you’ve come to the right place.

Wagtailenforcer makes use of the following packages to ensure strict password policies and other security protocols are implemented.

  • Lt. Marion “Cobra” Cobretti

Check out Awesome Wagtail for more awesome packages and resources from the Wagtail community.

Quickstart

  1. pip install wagtailenforcer

Time to edit the settings.py file. INSTALLED_APPS should have:

  1. ...
  2. 'axes',
  3. 'password_policies',
  4. 'wagtailenforcer',
  5. ...

.. and MIDDLEWARE_CLASSES:

  1. 'wagtailenforcer.middleware.WagtailenforcerMiddleware'

Some extra settings:

  1. # Password policy settings
  2. SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
  3. PASSWORD_CHECK_ONLY_AT_LOGIN = True
  4. PASSWORD_MIN_LENGTH = 7
  5. PASSWORD_MAX_LENGTH = 25
  6. PASSWORD_HISTORY_COUNT = 6
  7. PASSWORD_MIN_LETTERS = 1
  8. PASSWORD_MIN_NUMBERS = 1
  9. PASSWORD_MIN_SYMBOLS = 1
  10. PASSWORD_DIFFERENCE_DISTANCE = 3
  11. # Django Axes settings
  12. AXES_LOGIN_FAILURE_LIMIT = 5
  13. AXES_LOCK_OUT_AT_FAILURE = True
  14. AXES_ONLY_USER_FAILURES = True # Lock out based on username and not IP or UserAgent
  15. AXES_LOCKOUT_TEMPLATE = 'wagtailenforcer/lockout.html'
  16. # Antivirus
  17. CLAMAV_ACTIVE = True
  18. # Allowed document uploads extensions
  19. ALLOWED_DOCUMENT_EXTENSIONS = ['pdf']

In urls.py:

  1. from wagtailenforcer import urls as wagtailenforcer_urls
  2. wagtailadmin_urls.urlpatterns = wagtailenforcer_urls + wagtailadmin_urls.urlpatterns

Check the docs of the apps if you need to do changes to the predefined settings.

Development

Releases

  • Make a new branch for the release of the new version.
  • Update the CHANGELOG.
  • Update the version number in setup.py, following semver.
  • Make a PR and squash merge it.
  • Back on master with the PR merged, use make publish (confirm, and enter your password).
  • Finally, go to GitHub and create a release and a tag for the new version.
  • Done!