SentinelShield is a lightweight Web Application Firewall (WAF) and Intrusion Detection System (IDS) implemented in Python/Flask. It inspects incoming HTTP requests for malicious signatures and enforces behavioral rate-limiting to block abusive traffic and brute-force attempts.
| Metric / Category | Count / Value |
|---|---|
| Total Requests Processed | 25 |
| Malicious Requests Detected & Blocked | 12 |
| Legitimate Requests Allowed | 13 |
| SQL Injection (SQLi) Detected | 4 |
| Cross-Site Scripting (XSS) Detected | 4 |
| Path Traversal / LFI Detected | 2 |
| Rate Limit Violations (Abusive Traffic) | 2 |
| Top Flagged IP Address | 127.0.0.1 |
- Signature-Based Inspection: Incoming HTTP request parameters are compared against defined patterns in
rules.json. Requests containing payloads like' OR '1'='1,<script>, or../are intercepted by the WAF middleware and blocked withHTTP 403 Forbidden. - Behavioral Rate Limiting: The engine tracks client IP request frequency within a 60-second sliding window. Exceeding 10 requests triggers dynamic rate-limiting, responding with
HTTP 429 Too Many Requeststo prevent flooding or brute-force attacks. - Recommendations for Production:
- Implement parameterized queries to supplement signature inspection.
- Context-encode all web application outputs to neutralize XSS vulnerabilities.
- Enforce automated dynamic IP bans at the firewall level for persistent rate-limit offenders.
To build a foundational understanding of modern WAF/IDS architectures by creating a signature-matching, logging, and rate-limiting system using Python and Flask.
- Language/Framework: Python 3, Flask
- Data Protocols: JSON (
rules.json,security_logs.json) - Testing Capabilities:
curl, HTTP Client Browsers
- Rule Base Definition: Configured malicious attack signatures in
rules.json. - Middleware Initialization: Created
app.pywith custom WAF logic to inspect parameters prior to routing. - Simulated Attacks: Sent clean requests alongside crafted payloads (SQLi, XSS, Path Traversal) to verify detection behavior.
- Stress Testing: Sent rapid sequential requests to validate behavioral threshold enforcement.
- Log Audit: Inspected generated JSON logs via the
/dashboardendpoint to confirm alert tracking accuracy.
- Total Attacks Tested: 12
- Successful Detections: 12
- Detection Accuracy: 100%
- False Positives: 0
- False Negatives: 0