Giter Club home page Giter Club logo

django-pci-auth's Introduction

django-pci-auth

Django 1.4+ with SSL only

Note

Currently this application validates password fields via un-encrypted AJAX communication, use with SSL only! In the future this application may encrypt its AJAX communication via some JavaScript encryption library TBD.

This library integrates the current Django "best of" PCI auth libraries into a single application then fills in the gaps. Filling in the gaps involves making decisions for you e.g.:

And adding additional functionality e.g.:

  • Database models to persist event data e.g. lockouts (See: docs/MODELS.rst).
  • Additional recently_used validator for django-passwords.

Features

  • Stronger password hashing that allows for selection of hashing algorithm scrypt, bcrypt, PBKDF2, etc. via settings.py. [1]
  • Checking for strong passwords with a default length setting overrideable in settings.py. [2]
  • Integrate strong passwords into Django Admin.
  • Lock out account for n minutes after x failed log-in attempts. [3]
  • Set inactivity timeouts.
  • Generate event/email when lock-out occurs.
  • Set flags disallowing certain accounts to be locked out.
  • Log every log-on and explicit log-out (not necessary to log timed out log-ins).
  • Track last four passwords and do not allow re-use. [4]
  • Force password reset after X amount of time.
  • Provide JavaScript to check for strong passwords inline. [5]

Installation

Before you use this library in your applications you may wish to demo its functionality. To do so, follow these steps:

$ virtualenv .
$ bin/pip install django-pci-auth
$ bin/django-admin.py syncdb --settings=django_pci_auth.settings
$ bin/django-admin.py runserver --settings=django_pci_auth.settings

Open http://127.0.0.1:8000/

Libraries

A list of libraries included:

Articles

A list of relevant articles:

Settings

Stronger password hashing

This is a built-in feature in Django 1.4+. Documented here for convenience:

PASSWORD_HASHERS = (
    # From https://docs.djangoproject.com/en/1.4/topics/auth/:
    # "[redacted] This means that Django will use the first hash in the list
    # to store all passwords, but will support checking passwords stored with
    # the rest of the hashes in the list. If you remove a hash from the list
    # it will no longer be supported.
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.MD5PasswordHasher',
    'django.contrib.auth.hashers.CryptPasswordHasher',
)

Password Reuse

How many old passwords will you store? This feature will prevent users from using the same passwords over and over again; it will keep the last OLD_PASSWORD_STORAGE_NUM number of passwords around and remove anything older. E.g.:

OLD_PASSWORD_STORAGE_NUM = 4

Screenshots

Feature overview (via index view)

https://raw.github.com/aclark4life/django-pci-auth/master/docs/screenshot-index.png

Password length enforcement (with AJAX validation)

https://raw.github.com/aclark4life/django-pci-auth/master/docs/screenshot-ajax.png

Failed login attempts log

https://raw.github.com/aclark4life/django-pci-auth/master/docs/screenshot-axes.png

Recently used password log

https://raw.github.com/aclark4life/django-pci-auth/master/docs/screenshot-axes.png

License

This software is licensed under the same BSD license that Django itself is licensed under. See: LICENSE.

Notes

[1]This feature is included with Django 1.4+
[2]This feature is provided by django-passwords
[3]This feature is provided by django-axes
[4]aclark4life#3
[5]aclark4life#4

django-pci-auth's People

Contributors

aclark4life avatar daniell avatar kencochrane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.