adrianribao / cerberos Goto Github PK
View Code? Open in Web Editor NEWDjango cerberos is an app that watches failed login attempts and blocks the users after N times.
License: BSD 3-Clause "New" or "Revised" License
Django cerberos is an app that watches failed login attempts and blocks the users after N times.
License: BSD 3-Clause "New" or "Revised" License
I need some native English to review the docs since English is not my first language.
I do not use Django "sites" framework (I don't need it and I don't want to add it into INSTALLED_APPS). If I try to run my django project with cerberos installed, I got CommandError with this message:
"cerberos.failedaccessattempt: 'site' has a relation with model <class 'django.contrib.sites.models.Site'>, which has either not been installed or is abstract.".
A user-friendly approach is setting a fairly low timeout for a FailedLogin, but when the timeout has expired, currently the app deletes the FailedLogin object.
I imagine that keeping these objects around on a more permanent basis would be useful for security reviews, and spotting trends by "suspicious" ips that should get blocked at the firewall.
What do you think about adding a BooleanField on the model like:
expired = models.BooleanField(verbose_name=_(u'Expired'), default=False,
help_text=_(u'Indicates if the timeout has expired.'))
When the timeout has passed, just set
failed_access.expired = True
failed_access.save()
instead of deleting it (line 37 in decorators.py), and then .exclude(expired=True)
from the queryset when checking for failed logins (line 30 in decorators.py)?
I could whip up the code for this in the project, but setting up the migrations for the model is going to be a pain without the project setup, and don't want to end up committing a half-implemented changeset.
Apps using cerberos 0.2.0 currently raise a DeprecationWarning, which is seen on every run of a test suite of any project using Cerberos. I think you just need to change line 2 from
from django.conf.urls.defaults import *
to
from django.conf.urls import *
Thanks,
Andy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.