Skip to content

Latest commit

Β 

History

History
67 lines (42 loc) Β· 1.71 KB

File metadata and controls

67 lines (42 loc) Β· 1.71 KB

πŸ›‘οΈ WAF Demo Dashboard

A lightweight Web Application Firewall (WAF) demo that uses machine learning models to detect XSS and SQL Injection attacks. The system includes a Flask frontend, an orchestration API, and trained time series (TS) models. Deployed using Docker Compose for modularity and scalability.

πŸš€ Features

  • βœ… Flask-based web UI for testing payloads
  • βœ… Real-time ML-powered detection of XSS & SQLi
  • βœ… SQLite database with log persistence
  • βœ… Displays client IP & location via IP geolocation API
  • βœ… Live update of results using Socket.IO
  • βœ… Docker Compose orchestration for local development

🐳 Getting Started (with Docker Compose)

1. Clone the repo

git clone https://github.com/NirAlon/waf-demo.git
cd waf-demo

2. Build and run

docker-compose up --build

Frontend will be available at: πŸ‘‰ http://localhost:8003

🧠 How It Works

  1. Users input a test payload and attack type (XSS or SQLi) via the web UI.

  2. The Flask app sends the payload to the orchestration API.

  3. The orchestrator routes the request to the appropriate ML model.

  4. The model returns a score indicating whether the payload is malicious.

  5. The result is logged (along with IP/location) and shown in real-time on the dashboard.

πŸ§ͺ Example Payloads

  • SQLi: OR 1=1 --

  • XSS: <script>alert("XSS ATTACK")</script>

built With

  • Python (Flask, SQLAlchemy, requests)
  • TensorFlow / Scikit-learn (ML models)
  • Chart.js & Bootstrap (Frontend UI)
  • Docker & Docker Compose
  • Socket.IO (Live updates)
  • ipapi.co (for IP geolocation)

πŸ“œ License

MIT License Β© 2025 Nir Alon

πŸ‘€ Author

Nir Alon | Backend Engineer | ML Security Enthusiast | Infra Builder