Skip to content

abhisinghh72/networksecurity

Repository files navigation

πŸš€ Network Security: Phishing Detection System

An end-to-end Machine Learning + MLOps project for detecting phishing websites, built with a production-ready pipeline and deployed on AWS using CI/CD.

πŸ“Œ Overview

This project detects whether a given website is phishing or legitimate using a trained machine learning model.

It includes:

  • Full ML pipeline (data β†’ model β†’ prediction)
  • Experiment tracking with MLflow
  • Cloud storage (AWS S3)
  • Containerization (Docker)
  • CI/CD automation (GitHub Actions)
  • Deployment on AWS EC2
  • REST API using FastAPI

πŸ—οΈ Project Architecture

Data β†’ Pipeline β†’ MLflow β†’ S3 β†’ Docker β†’ ECR β†’ GitHub Actions β†’ EC2 β†’ FastAPI API

βš™οΈ Tech Stack

πŸ‘¨β€πŸ’» Backend & ML

  • Python
  • Scikit-learn
  • Pandas
  • NumPy

πŸš€ API

  • FastAPI
  • Uvicorn

πŸ“¦ MLOps & Tracking

  • MLflow
  • DagsHub

☁️ Cloud & DevOps

  • AWS S3
  • AWS ECR
  • AWS EC2
  • Docker

πŸ”„ CI/CD

  • GitHub Actions
  • Self-hosted Runner

πŸ“‚ Project Structure

networksecurity/
β”‚
β”œβ”€β”€ components/           # Data ingestion, transformation, training
β”œβ”€β”€ pipeline/             # Training & prediction pipelines
β”œβ”€β”€ cloud/                # AWS S3 sync logic
β”œβ”€β”€ utils/                # Helper utilities
β”œβ”€β”€ entity/               # Config & artifact entities
β”œβ”€β”€ exception/            # Custom exception handling
β”œβ”€β”€ logging/              # Logging module
β”‚
β”œβ”€β”€ app.py                # FastAPI app
β”œβ”€β”€ main.py               # Pipeline runner
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Dockerfile
└── .github/workflows     # CI/CD pipeline
WhatsApp Image 2026-05-01 at 11 32 55

πŸ”¬ Features

  • Modular ML pipeline (production-ready structure)
  • Automated training & prediction workflows
  • Experiment tracking with MLflow + DagsHub
  • Model & artifacts stored in AWS S3
  • Dockerized application
  • CI/CD pipeline using GitHub Actions
  • Auto deployment on EC2
  • FastAPI REST endpoints for real-time predictions

πŸ“‘ API Endpoints

Home

GET /

Train Model

GET /train

Predict

POST /predict

WhatsApp Image 2026-05-01 at 11 33 27

🐳 Docker Setup

Build Image

docker build -t networksecurity .
WhatsApp Image 2026-05-01 at 11 33 27 (1)

Run Container

docker run -d -p 8080:8080 networksecurity
WhatsApp Image 2026-05-01 at 11 33 28 (1)

☁️ AWS Deployment Flow

  1. Push code to GitHub
  2. GitHub Actions triggers CI/CD
  3. Docker image is built
  4. Image pushed to AWS ECR
  5. EC2 pulls latest image
  6. Container runs automatically
WhatsApp Image 2026-05-01 at 11 33 29

πŸ”„ CI/CD Pipeline

The pipeline includes:

  • Code checkout
  • Build Docker image
  • Push to AWS ECR
  • Deploy to EC2
WhatsApp Image 2026-05-01 at 11 33 28 (1)

πŸ“Š Experiment Tracking

  • Integrated MLflow with DagsHub
  • Tracks:
    • Accuracy
    • Precision
    • Recall
    • F1-score
  • Enables comparison across multiple runs
WhatsApp Image 2026-05-01 at 11 33 28 (2)

πŸ“¦ Storage

  • AWS S3 for:
    • Model artifacts
    • Pipeline outputs
    • Versioned storage
WhatsApp Image 2026-05-01 at 11 33 27 (2)

🌐 Live API

http://13.217.93.214:8080/docs

Swagger UI for testing endpoints.


πŸš€ How to Run Locally

# Clone repo
git clone https://github.com/abhisinghh72/networksecurity.git

# Create virtual environment
python -m venv venv
source venv/bin/activate   # Mac/Linux
venv\Scripts\activate      # Windows

# Install dependencies
pip install -r requirements.txt

# Run app
python app.py

🎯 Use Cases

  • Detect phishing URLs
  • Integrate into browser extensions
  • Security and fraud detection systems

πŸ“ˆ Future Improvements

  • Browser extension for real-time URL checking
  • Frontend dashboard
  • Advanced models (XGBoost, Deep Learning)
  • Real-time prediction system

πŸ‘€ Author

Abhishek Singh

About

end-to-end phishing detection system using ML, FastAPI, Docker, and AWS with CI/CD deployment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages