Network Security ML

End-to-end ML project for phishing website detection with FastAPI, scikit-learn, and MongoDB. Includes automated training pipeline and REST API deployment.

Cybersecurity & Ethical HackingPythonMIT

Abstract

Network Security ML is an open-source Cybersecurity & Ethical Hacking project. End-to-end ML project for phishing website detection with FastAPI, scikit-learn, and MongoDB. Includes automated training pipeline and REST API deployment. An end-to-end machine learning project for detecting phishing websites using scikit-learn, FastAPI, MongoDB, and Docker. This project implements a complete MLOps pipeline with experiment tracking (MLflow + DagHub), automated deployment, and production-ready REST API. It is built using Python. Key capabilities include: Automated ML Pipeline: Complete training pipeline with data ingestion, validation, transformation, and model training; REST API: FastAPI-based web service for real-time predictions with interactive Swagger docs; MongoDB Integration: Scalable cloud data storage and retrieval from MongoDB Atlas. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building a Cybersecurity & Ethical Hacking mini project or final-year project.

1. Introduction

An end-to-end machine learning project for detecting phishing websites using scikit-learn, FastAPI, MongoDB, and Docker. This project implements a complete MLOps pipeline with experiment tracking (MLflow + DagHub), automated deployment, and production-ready REST API.

2. Objective

End-to-end ML project for phishing website detection with FastAPI, scikit-learn, and MongoDB. Includes automated training pipeline and REST API deployment.

This project demonstrates how Python can be applied to a real-world Cybersecurity & Ethical Hacking problem.

3. Key Features / Modules

  • Automated ML Pipeline: Complete training pipeline with data ingestion, validation, transformation, and model training
  • REST API: FastAPI-based web service for real-time predictions with interactive Swagger docs
  • MongoDB Integration: Scalable cloud data storage and retrieval from MongoDB Atlas
  • MLflow + DagHub: Complete experiment tracking, metrics logging, and model versioning
  • Docker Deployment: Production-ready containerized application with Docker Compose support
  • Batch Predictions: Upload CSV files for bulk predictions via API
  • Drift Detection: Automated data drift detection using Kolmogorov-Smirnov test
  • Logging & Exception Handling: Comprehensive logging and custom exception handling throughout
  • Automated Scripts: One-click deployment scripts for Windows (.ps1) and Linux (.sh)

4. Technology Stack

Python
  • Python 3.8+
  • scikit-learn - Machine learning models
  • FastAPI - REST API framework
  • MongoDB Atlas - Cloud NoSQL database
  • Pandas & NumPy - Data processing
  • MLflow + DagHub - Experiment tracking & model registry
  • Scipy - Statistical tests for drift detection
  • Uvicorn - ASGI server

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later
  • pip / virtualenv for dependencies
  • VS Code, PyCharm or Jupyter Notebook
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/aashishkumar-tech/network-security-ml.git
cd network-security-ml
  1. Create a MongoDB Atlas account at
  2. Create a new cluster
  3. Database Access: Create a user with read/write permissions
  4. Network Access: Add your IP address or allow access from anywhere (0.0.0.0/0)
  5. Get your connection string and update the .env file
  6. DOCKER_QUICKSTART.md - Quick reference
  7. Docker Deployment Guide - Complete guide
pip install -r requirements.txt
# Windows PowerShell
.\deploy-docker.ps1

# Or manually
docker build -t network-security:latest .
docker run -d -p 8000:8000 --env-file .env network-security:latest
# Linux/Mac
chmod +x deploy-docker.sh
./deploy-docker.sh

# Or using Docker Compose
docker-compose up -d
# Windows PowerShell
.\deploy-docker.ps1

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Add logging and alert notifications (email / Telegram)
  • Write a threat model document for the tool
  • Package it with Docker for safe lab testing

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. Which threat or attack does this project defend against?
  2. What detection or protection technique is used and what are its limits?
  3. How are false positives and false negatives handled?
  4. Which cryptographic algorithms or security standards are involved?
  5. What legal and ethical rules apply when testing a tool like this?

9. Source Code & License

This project is developed by aashishkumar-tech and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on a Cybersecurity & Ethical Hacking project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Cybersecurity & Ethical Hacking Internship