A Django library to secure the admin panel by faking login pages and logging attempts.
Project description
djadminshield
djadminshield is a Django library designed to secure your admin panel by creating fake login page and tracking unauthorized access attempts. Enhance your website's security and stay ahead of potential hackers!
Features
- Fake admin login page that mimic the real admin login.
- Logs unauthorized login attempts with detailed information:
- IP address, browser, OS, device type, and preferred languages.
- A description of attempts, including warnings for guessed credentials.
- Protect your real admin panel with customizable login URLs.
Installation
Install the library by using pip:
pip install djadminshield
Setup
-
Add to Installed Apps
Add
djadminshieldto yourINSTALLED_APPSinsettings.py:INSTALLED_APPS = [ ..., 'djadminshield', ]
-
Apply Database Migrations
Run the following command to apply the necessary migrations:
python manage.py migrate
-
Create a Superuser
If you haven't already created a superuser, do so now:
python manage.py createsuperuser
Configuration
Update your project's urls.py file:
from django.contrib import admin
from django.urls import include, path
from djadminshield import views
urlpatterns = [
path('admin/', views.fake_admin_login, name='fake_admin_login'),
path('real-admin-url/', admin.site.urls),
]
- Replace
'real-admin-url/'with a unique and unguessable route for your actual admin login (e.g.,'secure-admin-login/').
How to test
- Navigate to the
/adminURL of your project.- You'll see a fake admin login page identical to the real one.
- Attempt to login with invalid credentials.
- These attempts will be logged and visible in the Django admin dashboard under the "Unauthorized Access Attempts" table in the "DJADMINSHIELD" section.
- Check the logs for information such as:
- IP address, attempt time, browser, OS, and description.
- If someone successfully guess the credentials, the fake login page will still prevent access while login the activity.
Example Use Case
-
Use this library to monitor and analyze unauthorized login attempts.
-
Identify potential threats based on logged data and take immediate actions, such as updating the passwords.
GitHub Repository
Here is the djadminshield GitHub Repository. Feel free to check it out! 😊😊😊
If you find this library helpful, please consider giving the repository a ⭐ to show your support. Contribution and suggestions are always welcome--feel to raise issues or submit pull requests!
Updates Log
-
v0.1.0 - Initial release with full functionality to secure Django admin dashboard.
-
v0.1.1 - Updated the README.md file with more accurate and easy to follow instructions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djadminshield-0.1.1.tar.gz.
File metadata
- Download URL: djadminshield-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c68d08ba1cfb156c66585a3b19c28114fcbbdfb35870cda0018f01631c779ed
|
|
| MD5 |
1099a196e24a34a1d7d617d554ce73ce
|
|
| BLAKE2b-256 |
9b355ce913006efa4aea68398db57ebbf8b37a0e8f105fa3aa48cb3a98ebb43b
|
File details
Details for the file djadminshield-0.1.1-py3-none-any.whl.
File metadata
- Download URL: djadminshield-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39ce3c128edf59788f2703bd3833432fb5e8dd1904b6637645b5c410476be0cd
|
|
| MD5 |
c903ee5d6a0eeaee3dde6ef25f0d4a94
|
|
| BLAKE2b-256 |
2390d47a2acc6b72c41d0faea8097a7988ac4ef038328e655735f48eefaa894c
|