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)
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.
- 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
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) |
✅ 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
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
- 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 onlocalhost:4000
- Enabled logging and verified detection of:
- Cross-Site Scripting (XSS)
- SQL Injection (SQLi)
/var/log/apache2/modsec_audit.log
View screenshots and logs in the /screenshots/
folder.
- 👤 View and manage users
- ➕ Add / 🗑️ Delete simulated user entries
- 🎨 Fully responsive UI
- 🔄 Partial re-rendering after DB operations
- 🔐 Data securely handled via Express & Mongoose
git clone https://github.com/kurogamidesuu/Cybergyan-Internship-Project.git
cd Cybergyan-Internship-Project
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
cd frontend
npm install
npm run dev
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.
curl -X POST -d "<script>alert('XSS')</script>" http://localhost
curl "http://localhost/?id=1' OR '1'='1"
🔒 Both payloads were blocked with HTTP 403 responses
📄 Details available in modsec_audit.log
-
✔️ 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
- Hempushp Chauhan
GitHub: @kurogamidesuu
LinkedIn: Hempushp Chauhan