The Network Security System is an end-to-end phishing detection pipeline built with FastAPI and modular ML components.
It allows users to either:
- Upload a CSV file for batch phishing detection (results shown in an HTML table).
- Use the REST API endpoints programmatically for training and prediction.
The system demonstrates production-style ML engineering practices, including modular pipelines, centralized logging, Docker-based deployment, and integration with cloud platforms (Azure).
🌐 Web App: https://networksecurity-h4hsc3bph3fmevfq.centralus-01.azurewebsites.net
📦 Docker Hub: https://hub.docker.com/r/raw9k/network-security-app
- Training Pipeline: Retrain the phishing detection model via API (
/train). - Batch Prediction: Upload CSVs for phishing detection; results saved as CSV and rendered as HTML tables.
- Dual Usage: Accessible both through a browser-based interface and API clients (e.g., Postman, curl).
- Optional Database Support: MongoDB integration for ingestion (can be disabled in deployment).
- Cloud-Ready Deployment: Containerized with Docker, deployed on Azure Web App for Containers.
- Go to the deployed Azure app.
- Upload a CSV file containing URL features.
- Receive phishing detection results in a styled HTML table with summary statistics.
GET /→ Redirects to API docs.POST /predict→ Upload a CSV file for predictions (returns results as JSON or HTML).GET /train→ Retrains the ML pipeline (requires MongoDB).
- Language: Python 3.10+
- Backend: FastAPI, Starlette, Uvicorn
- Machine Learning: Scikit-learn, Pandas, Numpy
- Deployment: Docker, Azure Web App
- Optional Storage: MongoDB (for ingestion + retraining)
- Templating: Jinja2 + Bootstrap (UI for CSV upload & results)
- Python 3.10+
- Docker (optional, for containerized deployment)
- MongoDB instance (only required if you want retraining from raw data ingestion)
git clone https://github.com/raw9k/network-security-system.git
cd network-security-system
pip install -r requirements.txtuvicorn app:app --host 0.0.0.0 --port 8000 --reloadNow you can access the system:
API Docs → http://127.0.0.1:8000/docs
Home Page → http://127.0.0.1:8000/
Build and run the Docker container:
docker build -t network-security-system .
docker run -p 8000:8000 network-security-system- Open the home page in browser: http://localhost:8000
- Upload a CSV file of URL features for batch analysis.
- View phishing predictions in a styled HTML table.
- Or, go to /docs for Swagger UI to interact with the API.
- Built into a Docker image and deployed to Azure Web App for Containers.
- Supports both batch file uploads and REST API usage.
- CI/CD integration possible via GitHub Actions.
The Network Security System combines machine learning, REST APIs, and cloud deployment into a single project. With its modular design, Docker support, and Azure deployment, it serves as a strong prototype for real-world phishing detection systems, suitable for browser plugins, secure email gateways, and enterprise security monitoring.