Requirements:
- Redis (for tracking login attempts)
Installation:
1. Activate CKAN virtualenv
2. Clone and install:
git clone https://github.com/Datashades/ckanext-login-throttle.git
cd ckanext-login-throttle
pip install -e .
Add to ckan.plugins:
login-throttle
Configuration:
Lock timeout in seconds (default: 900 = 15 minutes)
ckanext.login_throttle.lock_timeout = 900
Maximum login attempts before lockout (default: 10)
ckanext.login_throttle.login_max_count = 10
Lock based on IP (default) or username
Leave empty or omit for IP-based locking
Set to ‘user_name’ for username-based locking
ckanext.login_throttle.brute_force_key = user_name
Path to custom email footer template (optional)
Default: uses lockout_footer.txt from repo
ckanext.login_throttle.brute_force_footer_path = /path/to/custom/footer.txt
Disable email notifications (default: False)
ckanext.login_throttle.disable_lock_notification = True
Features:
- Tracks failed login attempts in Redis
- Locks by IP address (default) or username
- Temporary lockout after max attempts reached
- Warning email sent to user when locked
- Fully configurable settings
Original code from ckanext-security.
Development:
git clone https://github.com/Datashades/ckanext-login-throttle.git
cd ckanext-login-throttle
pip install -e .
Testing: pytest –ckan-ini=test.ini