Skip to content

This project demonstrates a full-stack user management dashboard built using React, Vite, TailwindCSS, Node.js, Express, and MongoDB, protected by a Web Application Firewall (WAF) using Apache2, ModSecurity, and the OWASP Core Rule Set (CRS).

Notifications You must be signed in to change notification settings

kurogamidesuu/WAF-MERN-Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ CyberGyan Internship Project

Project Title: Implementation and Configuration of a Web Application Firewall (WAF)
Internship Provider: CDAC – CyberGyan Virtual Internship Program
Intern: Hempushp Chauhan
Mentor: Prateek Saraswat
Institution: NIT Hamirpur
Duration: June–July 2025 (6 Weeks)


🚀 Project Overview

This project focuses on securing a full-stack web application using a Web Application Firewall (WAF). The WAF is implemented using Apache2 with ModSecurity, powered by the OWASP Core Rule Set (CRS) to detect and block common attack vectors such as Cross-Site Scripting (XSS) and SQL Injection (SQLi).

Additionally, a complete MERN-based User Management Dashboard was developed to simulate real-world user interaction and serve as a testing ground for WAF functionality.

🎯 Objectives:

  • Deploy and configure ModSecurity as a WAF with Apache2
  • Integrate OWASP CRS for intelligent rule-based filtering
  • Build a MERN Stack dashboard to simulate frontend/backend traffic
  • Test the firewall using real-world malicious payloads

🧰 Tech Stack

Layer Technology
Frontend React + Vite + TailwindCSS
Backend Express.js (Node.js)
Database MongoDB + Mongoose
WAF Layer Apache2 + ModSecurity + OWASP CRS
Deployment Apache HTTP Server (Reverse Proxy)

🧱 Key Features

Full-Stack User Dashboard
WAF Filtering with ModSecurity + OWASP CRS
Reverse Proxy via Apache
Real-Time Logging in modsec_audit.log
Blocked XSS and SQLi Payloads with 403 Responses
Clean, Responsive UI using TailwindCSS


📁 Project Structure

Cybergyan-Internship-Project/
├── backend/ # Node.js + Express + MongoDB backend
├── frontend/ # React + Vite frontend
├── screenshots/ # Proof of WAF detection (curl logs, browser, audit logs)
├── waf-setup.md # Step-by-step WAF configuration guide
├── .env.example # Sample environment file
└── README.md

🔐 Web Application Firewall (WAF)

🔧 Setup Overview

  • Installed Apache2 and ModSecurity on Ubuntu 22.04
  • Integrated OWASP CRS (v3.3.7) for comprehensive protection
  • Configured reverse proxy from localhost:80 to Node backend on localhost:4000
  • Enabled logging and verified detection of:
    • Cross-Site Scripting (XSS)
    • SQL Injection (SQLi)

📁 WAF Logs Path

/var/log/apache2/modsec_audit.log

View screenshots and logs in the /screenshots/ folder.


🧑‍💻 Dashboard Features

  • 👤 View and manage users
  • ➕ Add / 🗑️ Delete simulated user entries
  • 🎨 Fully responsive UI
  • 🔄 Partial re-rendering after DB operations
  • 🔐 Data securely handled via Express & Mongoose

⚙️ Installation & Setup

1. Clone the Repository

git clone https://github.com/kurogamidesuu/Cybergyan-Internship-Project.git
cd Cybergyan-Internship-Project

2. Backend Setup

cd backend
npm install
cp .env.example .env  # Or manually add your MongoDB URI
# .env should contain: MONGO_URI=mongodb://localhost:27017/waf-dashboard
node server.js

3. Frontend Setup (Development Mode)

cd frontend
npm install
npm run dev

4. Build Frontend for Production

cd frontend
npm run build
# Output goes to frontend/dist — served via Apache or Express

*check waf-setup.md for a guide on how to install Modsecurity with Apache2.

🧪 Security Testing

XSS Payload

curl -X POST -d "<script>alert('XSS')</script>" http://localhost

SQL Injection

curl "http://localhost/?id=1' OR '1'='1"

🔒 Both payloads were blocked with HTTP 403 responses

📄 Details available in modsec_audit.log

📚 Learnings

  • ✔️ Setting up and configuring ModSecurity with OWASP CRS

  • ✔️ Building secure and modular MERN Stack Applications

  • ✔️ Implementing Reverse Proxies with Apache2

  • ✔️ Testing and logging real-world attack vectors

🧾 References

ModSecurity Handbook

OWASP Core Rule Set

Apache HTTP Server Docs

React Docs

🙋‍♂️ Author

  • Hempushp Chauhan

GitHub: @kurogamidesuu

LinkedIn: Hempushp Chauhan

About

This project demonstrates a full-stack user management dashboard built using React, Vite, TailwindCSS, Node.js, Express, and MongoDB, protected by a Web Application Firewall (WAF) using Apache2, ModSecurity, and the OWASP Core Rule Set (CRS).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published