CyberSafe IDS is an intelligent, user-friendly Intrusion Detection System that leverages machine learning to analyze network traffic and detect anomalies in real time.
It features a modern web interface, user management, statistics, and actionable recommendations for network security.
- Features
- Tech Stack
- Screenshots
- Project Structure
- Quickstart
- Usage
- Configuration
- For Developers
- Security Notes
- Support
- License
- Collaborators
- Real-time Network Traffic Analysis
- Machine Learning-based Detection (XGBoost, 41 features)
- User Authentication & Roles (admin/user)
- Detailed Statistics & Analytics
- Profile Management with Image Upload
- Dark Mode Support
- Responsive, Modern UI (Tailwind CSS)
- Actionable Security Recommendations
- Python 3 (core programming language)
- Flask (web framework)
- scikit-learn (machine learning & preprocessing)
- XGBoost (model training)
- MySQL (database)
- Tailwind CSS (frontend styling)
- HTML5 & Jinja2 (front end structure)
- JavaScript (frontend interactivity)
- Joblib (model serialization)
- Werkzeug (security, password hashing)
- Pillow (image processing for profile uploads)
Home Page
Alt: Home page showing navigation bar, hero section, and quick links.
Statistics Page
Alt: Dashboard with charts and tables showing detection statistics, normal vs anomaly counts, and user activity.
Login Page
Alt: Login form for existing users with username and password fields.
.
├── app.py
├── requirements.txt
├── models/
│ └── xgboost_best_model.pkl
├── dataset/
│ └── Train_data_Dataset.csv
├── templates/
│ ├── index.html
│ ├── predict.html
│ ├── result.html
│ ├── statistics.html
│ ├── signup.html
│ ├── login.html
│ ├── profile.html
│ └── admin_users.html
├── static/
│ ├── uploads/
│ └── images/
└── README.md
- Clone the repository:
git clone <your-repo-url> cd <your-project-folder>
- (Recommended) Create and activate a virtual environment:
- On Windows:
python -m venv venv venv\Scripts\activate
- On macOS/Linux:
python3 -m venv venv source venv/bin/activate
- On Windows:
- Install dependencies:
(All required Python packages are listed in
pip install -r requirements.txt
requirements.txt.) - Ensure MySQL server is running.
- Default config: user
root, password'', hostlocalhost - Update credentials in
app.pyif needed.
- Default config: user
- Place your trained model file:
models/xgboost_best_model.pkl - Run the app:
python app.py
- Open your browser:
http://localhost:5000
- Sign up for a new account.
- Log in and access the detection analysis page.
- Fill in all 41 features (use dropdowns for categorical fields).
- Submit to analyze traffic and view results.
- View statistics and manage your profile.
- MySQL Credentials:
Editmysql_configinapp.pyif your MySQL user/password is different. - Model File:
Must match the 41-feature input and label encoding as defined inapp.py.
- Model Training:
Use your own notebook to train and export the model asxgboost_best_model.pkl. - Feature Engineering:
Ensure the order and encoding of features matches between training andapp.py.
- All user passwords are securely hashed.
- Only admins can access user management.
- All new signups are assigned the "user" role by default.
- Email: abdukadir.sharif@just.edu.so
- Phone: +252 617273320
This project is for educational and research purposes.
Contact the author for commercial or production use.
