Overview
SBproxy provides built-in security policies that are evaluated on every request before authentication and action execution. Multiple policies can be combined and execute in the order they appear in the configuration array. If any policy blocks or challenges a request, processing stops immediately.
Capabilities
- WAF - ModSecurity-compatible rules with OWASP Core Rule Set (CRS) support
- DDoS protection - Adaptive thresholds with challenge-response mitigation (JavaScript, CAPTCHA, proof-of-work)
- Rate limiting - Token bucket and fixed window algorithms with per-IP, per-key, and global keying
- IP filter - Whitelist/blacklist by IP address or CIDR range with dynamic blocklist loading
- Security headers - HSTS, CSP (with nonce/hash, scriptable directives, SRI report-uri), X-Frame-Options, and more
- CSRF protection - Double-submit cookie pattern with signed tokens
- SRI - Subresource integrity verification
- OpenAPI validation - Reject requests that do not match a published OpenAPI 3.0 spec
- Exposed credentials - Detect known-leaked passwords on inbound Basic-auth and tag or block
- Bulk redirects - Compile a list of source-to-destination paths into an O(1) redirect table
Example
Apply rate limiting with the token bucket algorithm:
proxy:
http_bind_port: 8080
origins:
"api.example.com":
action:
type: proxy
url: https://test.sbproxy.dev
policies:
- type: rate_limiting
requests_per_second: 5
burst: 10
key: ip
Test it:
curl -H "Host: api.example.com" http://localhost:8080/