Skip to content

Commit e8b4d5b

Browse files
docs: clarify native Rust implementation, reference sentinel-agent-modsec
- Add note that this agent uses native Rust regex, not libmodsecurity - Reference sentinel-agent-modsec for full OWASP CRS compatibility - Update comparison table to show both agent options - Add "When to use" guidance for choosing between agents 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 68665a3 commit e8b4d5b

2 files changed

Lines changed: 32 additions & 13 deletions

File tree

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# sentinel-agent-waf
22

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.
46
57
## Features
68

@@ -65,6 +67,8 @@ sentinel-waf-agent --socket /var/run/sentinel/waf.sock --paranoia-level 1
6567

6668
## Detection Rules
6769

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+
6872
### SQL Injection (942xxx)
6973
- UNION-based injection
7074
- Tautology attacks (`OR 1=1`)
@@ -153,21 +157,32 @@ sentinel-waf-agent --exclude-paths "/health,/metrics,/static"
153157

154158
## Comparison with ModSecurity
155159

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:
157161

158-
| Feature | This Agent | ModSecurity |
159-
|---------|------------|-------------|
162+
| Feature | sentinel-agent-waf | sentinel-agent-modsec |
163+
|---------|-------------------|----------------------|
160164
| SQL Injection | ✓ | ✓ |
161165
| XSS | ✓ | ✓ |
162166
| Path Traversal | ✓ | ✓ |
163167
| Command Injection | ✓ | ✓ |
164-
| Full CRS Ruleset | Partial | ✓ |
165-
| Body Inspection | | ✓ |
168+
| Full CRS Ruleset | ~20 rules | 800+ rules |
169+
| SecLang Support | - | ✓ |
166170
| 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
171186

172187
## Development
173188

ROADMAP.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,16 @@ Add WebSocket frame inspection for detecting attacks in WebSocket traffic.
9393

9494
## Non-Goals
9595

96-
These are explicitly out of scope:
96+
These are explicitly out of scope for this agent:
9797

98-
- **Full OWASP CRS compatibility** - We implement a useful subset, not the full ruleset
99-
- **ModSecurity rule language** - We use native Rust regex, not SecLang
98+
- **Full OWASP CRS compatibility** - We implement a useful subset (~20 rules), not the full 800+ ruleset. For full CRS, see [sentinel-agent-modsec](https://github.com/raskell-io/sentinel-agent-modsec)
99+
- **ModSecurity rule language (SecLang)** - We use native Rust regex patterns, not SecLang. For SecLang support, see [sentinel-agent-modsec](https://github.com/raskell-io/sentinel-agent-modsec)
100100
- **Learning mode / ML-based detection** - Keep it simple and deterministic
101101

102+
## Related Projects
103+
104+
- **[sentinel-agent-modsec](https://github.com/raskell-io/sentinel-agent-modsec)** - Full OWASP CRS WAF agent using libmodsecurity bindings. Use this when you need comprehensive protection with 800+ rules or existing SecLang rules.
105+
102106
---
103107

104108
## Compatibility

0 commit comments

Comments
 (0)