| Crates.io | sentinel-agent-waf |
| lib.rs | sentinel-agent-waf |
| version | 0.1.0 |
| created_at | 2025-12-25 15:02:41.98895+00 |
| updated_at | 2025-12-25 15:02:41.98895+00 |
| description | Web Application Firewall agent for Sentinel reverse proxy - SQL injection, XSS, and attack detection |
| homepage | https://sentinel.raskell.io |
| repository | https://github.com/raskell-io/sentinel-agent-waf |
| max_upload_size | |
| id | 2004636 |
| size | 86,407 |
Web Application Firewall agent for Sentinel reverse proxy. Detects and blocks common web attacks.
cargo install sentinel-agent-waf
git clone https://github.com/raskell-io/sentinel-agent-waf
cd sentinel-agent-waf
cargo build --release
sentinel-waf-agent --socket /var/run/sentinel/waf.sock --paranoia-level 1
| Option | Environment Variable | Description | Default |
|---|---|---|---|
--socket |
AGENT_SOCKET |
Unix socket path | /tmp/sentinel-waf.sock |
--paranoia-level |
WAF_PARANOIA_LEVEL |
Sensitivity (1-4) | 1 |
--sqli |
WAF_SQLI |
Enable SQL injection detection | true |
--xss |
WAF_XSS |
Enable XSS detection | true |
--path-traversal |
WAF_PATH_TRAVERSAL |
Enable path traversal detection | true |
--command-injection |
WAF_COMMAND_INJECTION |
Enable command injection detection | true |
--protocol |
WAF_PROTOCOL |
Enable protocol attack detection | true |
--block-mode |
WAF_BLOCK_MODE |
Block (true) or detect-only (false) | true |
--exclude-paths |
WAF_EXCLUDE_PATHS |
Paths to exclude (comma-separated) | - |
--verbose |
WAF_VERBOSE |
Enable debug logging | false |
| Level | Description |
|---|---|
| 1 | High-confidence detections only (recommended for production) |
| 2 | Adds medium-confidence rules, more false positives possible |
| 3 | Adds low-confidence rules, requires tuning |
| 4 | Maximum sensitivity, expect false positives |
OR 1=1)--, #, /**/)SLEEP(), BENCHMARK())<script>)onclick=, onerror=)javascript:)data:text/html)../, ..\\)%2e%2e%2f)/etc/passwd, c:\\windows); ls, | cat)$(...), backticks)cmd.exe, powershell)agents {
agent "waf" {
type "custom"
transport "unix_socket" {
path "/var/run/sentinel/waf.sock"
}
events ["request_headers"]
timeout-ms 50
failure-mode "open"
}
}
routes {
route "all" {
matches { path-prefix "/" }
upstream "backend"
agents ["waf"]
}
}
# Environment variables
WAF_PARANOIA_LEVEL: "1"
WAF_BLOCK_MODE: "true"
WAF_EXCLUDE_PATHS: "/health,/metrics"
On blocked requests:
X-WAF-Blocked: trueX-WAF-Rule: <rule_id>In detect-only mode, the request continues but includes:
X-WAF-Detected: <rule_ids>Exclude paths from WAF inspection:
sentinel-waf-agent --exclude-paths "/health,/metrics,/static"
This agent provides a subset of ModSecurity's OWASP CRS functionality:
| Feature | This Agent | ModSecurity |
|---|---|---|
| SQL Injection | ✓ | ✓ |
| XSS | ✓ | ✓ |
| Path Traversal | ✓ | ✓ |
| Command Injection | ✓ | ✓ |
| Full CRS Ruleset | Partial | ✓ |
| Body Inspection | - | ✓ |
| Custom Rules | - | ✓ |
| Dependencies | Pure Rust | libmodsecurity |
| Installation | cargo install |
Complex |
For full OWASP CRS compatibility, consider using ModSecurity with Sentinel's external processing.
# Run with debug logging
RUST_LOG=debug cargo run -- --socket /tmp/test.sock --paranoia-level 2
# Run tests
cargo test
MIT OR Apache-2.0