|
1 | 1 | # sentinel-agent-waf |
2 | 2 |
|
3 | | -Web Application Firewall agent for [Sentinel](https://github.com/raskell-io/sentinel) reverse proxy. Detects and blocks common web attacks. |
| 3 | +A lightweight Web Application Firewall agent for [Sentinel](https://github.com/raskell-io/sentinel) reverse proxy. Detects and blocks common web attacks using **native Rust regex patterns** - no external dependencies on libmodsecurity or other C libraries. |
| 4 | + |
| 5 | +> **Note:** This agent implements a curated subset of detection rules inspired by OWASP CRS rule IDs, but does **not** use libmodsecurity or the full CRS ruleset. For full OWASP CRS compatibility, see [sentinel-agent-modsec](https://github.com/raskell-io/sentinel-agent-modsec) which wraps libmodsecurity. |
4 | 6 |
|
5 | 7 | ## Features |
6 | 8 |
|
@@ -65,6 +67,8 @@ sentinel-waf-agent --socket /var/run/sentinel/waf.sock --paranoia-level 1 |
65 | 67 |
|
66 | 68 | ## Detection Rules |
67 | 69 |
|
| 70 | +Detection rules are implemented as native Rust regex patterns. Rule IDs follow OWASP CRS numbering conventions for familiarity, but the patterns are hand-written and optimized for performance - they are **not** imported from ModSecurity/CRS. |
| 71 | + |
68 | 72 | ### SQL Injection (942xxx) |
69 | 73 | - UNION-based injection |
70 | 74 | - Tautology attacks (`OR 1=1`) |
@@ -153,21 +157,32 @@ sentinel-waf-agent --exclude-paths "/health,/metrics,/static" |
153 | 157 |
|
154 | 158 | ## Comparison with ModSecurity |
155 | 159 |
|
156 | | -This agent provides a subset of ModSecurity's OWASP CRS functionality: |
| 160 | +This agent provides a lightweight alternative to ModSecurity with a subset of OWASP CRS-style detection: |
157 | 161 |
|
158 | | -| Feature | This Agent | ModSecurity | |
159 | | -|---------|------------|-------------| |
| 162 | +| Feature | sentinel-agent-waf | sentinel-agent-modsec | |
| 163 | +|---------|-------------------|----------------------| |
160 | 164 | | SQL Injection | ✓ | ✓ | |
161 | 165 | | XSS | ✓ | ✓ | |
162 | 166 | | Path Traversal | ✓ | ✓ | |
163 | 167 | | Command Injection | ✓ | ✓ | |
164 | | -| Full CRS Ruleset | Partial | ✓ | |
165 | | -| Body Inspection | ✓ | ✓ | |
| 168 | +| Full CRS Ruleset | ~20 rules | 800+ rules | |
| 169 | +| SecLang Support | - | ✓ | |
166 | 170 | | Custom Rules | - | ✓ | |
167 | | -| Dependencies | Pure Rust | libmodsecurity | |
168 | | -| Installation | `cargo install` | Complex | |
169 | | - |
170 | | -For full OWASP CRS compatibility, consider using ModSecurity with Sentinel's external processing. |
| 171 | +| Body Inspection | ✓ | ✓ | |
| 172 | +| Dependencies | Pure Rust | libmodsecurity (C) | |
| 173 | +| Installation | `cargo install` | Requires libmodsecurity | |
| 174 | +| Binary Size | ~5MB | ~50MB | |
| 175 | +| Memory Usage | Low | Higher | |
| 176 | + |
| 177 | +**When to use this agent:** |
| 178 | +- You want simple, zero-dependency deployment |
| 179 | +- You need low latency and minimal resource usage |
| 180 | +- Basic attack detection is sufficient for your use case |
| 181 | + |
| 182 | +**When to use [sentinel-agent-modsec](https://github.com/raskell-io/sentinel-agent-modsec):** |
| 183 | +- You need full OWASP CRS compatibility |
| 184 | +- You have existing ModSecurity/SecLang rules to migrate |
| 185 | +- You require comprehensive protection with 800+ detection rules |
171 | 186 |
|
172 | 187 | ## Development |
173 | 188 |
|
|
0 commit comments