How openappsec/waf-comparison-project works
Project type and purpose
• This is a Python-based test automation tool whose purpose is to compare the efficacy of multiple Web Application Firewalls (WAFs). It ingests large sets of legitimate and malicious HTTP request data, sends them to configured WAF endpoints, records responses in a database, and computes security metrics (true positive/false positive rates).
File structure
• Top-level files and directories:
• Data/ – contains “Legitimate” and “Malicious” subfolders of HTTP request files
• config_template.py – blueprint for WAF URLs, database credentials, thread counts
• runner.py – main entry point that orchestrates the pipeline
• analyzer.py – computes performance metrics from logged results
• helper.py – utility functions for HTTP requests, threading, health checks
• analyzer.py, helper.py, runner.py, analyzer.py – form the core modules
• requirements.txt – third-party libraries (e.g., requests, psycopg2)
• No frontend; purely a backend automation pipeline.
README for additional insights
• Workflow:
1. Copy config_template.py → config.py (enter WAF URLs + DB settings)
2. Health-check each WAF (connectivity + prevention mode)
3. Load two datasets and dispatch each request in multi-threaded fashion via requests library
4. Log every WAF response to an external PostgreSQL (AWS RDS)
5. Post-processing via analyzer.py to generate balanced scores
• External dependencies: WAF endpoints, optional upstream nginx, AWS RDS Postgres, datasets on disk.
Final pointers
• Configuration as a first-class component.
• Make the multithreading dispatch step explicit so reviewers understand performance scaling.
• Optional nginx upstream if used in certain test scenarios.