Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1a6c6cb
Mark legacy defense benchmark artifacts historical
Jun 25, 2026
11e4366
Bound TCP relay activity notifications
Jun 25, 2026
303fd82
Prune stale filter activation state
Jun 25, 2026
cd8f175
Enforce recorded local benchmark probes
Jun 25, 2026
b5abddc
Enforce edge packet benchmark guardrails
Jun 25, 2026
995fa6d
Enforce admin control-plane rate guards
Jun 25, 2026
994217b
Enforce resource startup benchmark guards
Jun 25, 2026
5f2ab41
Enforce trusted client benchmark guards
Jun 25, 2026
86bd5bd
Enforce HTTP admission benchmark guards
Jun 25, 2026
fe7b40d
Enforce rate response benchmark guards
Jun 25, 2026
0d33b26
Enforce remaining benchmark observations
Jun 25, 2026
b1ea07e
Improve local benchmark startup diagnostics
Jun 25, 2026
70eeb86
Honor whitespace in content length guards
Jun 25, 2026
9d03da4
Tighten host allowlist authority matching
Jun 25, 2026
5b69f0e
Reject merged filter rule id collisions
Jun 25, 2026
fe5991c
Inspect duplicate header values in filters
Jun 25, 2026
5f9866e
Harden request signature fingerprints
Jun 25, 2026
efd8029
Validate learned filter signatures
Jun 25, 2026
be33fa1
Reject non-literal custom client IP headers
Jun 25, 2026
38de36c
Parse hop-by-hop headers from bytes
Jun 25, 2026
b47d326
Bound empty transfer encoding elements
Jun 25, 2026
6117870
Validate raw initial header names
Jun 25, 2026
c23d379
Validate upstream response framing
Jun 25, 2026
e94b4ca
Validate filter rule header ids
Jun 25, 2026
1059270
Deconflict learned filter IDs
Jun 25, 2026
b5dfe39
Sanitize learned filter matchers
Jun 25, 2026
380b142
Run nftables template validation with sudo in CI
Jun 25, 2026
5c94af2
Address PR hardening review findings
Jun 25, 2026
f61b1c4
Accept canonical nft flag output in edge smoke
Jun 25, 2026
8813497
Keep local benchmark edge validation unprivileged
Jun 25, 2026
954af28
Normalize edge smoke nft output checks
Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
tools/test_ai_tools.py \
tools/validate_edge_templates.py
PYTHONPATH=tools python3 tools/test_ai_tools.py
python3 tools/validate_edge_templates.py --config configs/example.json
sudo python3 tools/validate_edge_templates.py --config configs/example.json
python3 tools/assert_defense_bench.py \
--audit-tracked-artifacts benchmark_results \
--artifact-manifest benchmark_results/defense_artifacts_manifest.json
Expand Down
70 changes: 70 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "MIT"
[dependencies]
clap = { version = "4", features = ["derive"] }
bytes = "1"
blake3 = "1"
http = "1"
http-body-util = "0.1"
hyper = { version = "1", features = ["client", "http1", "server"] }
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ deterministic generator otherwise.

- HTTP/1 reverse proxy with per-client prefix, per-signature, per-path-shape route-family, trusted-proxy aggregate, and global token-bucket limits.
- Bounded rate-limiter state that evicts stale buckets but denies new active keys when a shard is full, so high-cardinality rotation cannot reset existing hot IP, signature, or path-shape buckets.
- HTTP method allowlist, Host header validation, bounded trusted `X-Forwarded-For` parsing, forwarded-header/client-IP spoof sanitization, normalized request-signature and path-shape rate caps that collapse long dynamic tokens plus high-confidence short tokens without merging version segments such as `/api/v1` and `/api/v2`, bounded sibling-churn limiting for short lowercase token rotation under one parent route, trusted-proxy aggregate rate and in-flight caps, downstream keep-alive disabled by default, downstream write timeout for slow readers, raw initial HTTP/1 header/framing validation with incremental delimiter scanning plus hard byte, per-field, and count caps, request framing validation, request content-encoding policy, default chunked request-body rejection with opt-in, default `Expect` rejection with opt-in `100-continue`, bounded `Range` request policy, default origin `Accept-Encoding` stripping with opt-in passthrough, connection-open rate caps, active connection caps, sharded `SO_REUSEPORT` accept sockets, in-flight upstream request caps, upstream connect timeout, path-shape-scoped passive upstream failure circuit breaker, per-connection request caps, request and upstream response header byte/field/count caps and timeouts, default-stripped HTTP trailers with opt-in capped forwarding, request/upstream body recent-window minimum data-rate guards, request body guardrails, and upstream response body guardrails.
- HTTP method allowlist, Host header validation, bounded trusted `X-Forwarded-For` parsing, forwarded-header/client-IP spoof sanitization, normalized request-signature and path-shape rate caps that collapse long dynamic tokens plus high-confidence short tokens without merging version segments such as `/api/v1` and `/api/v2`, bounded sibling-churn limiting for short lowercase token rotation under one parent route, trusted-proxy aggregate rate and in-flight caps, downstream keep-alive disabled by default, downstream write timeout for slow readers, raw initial HTTP/1 header/framing validation with incremental delimiter scanning plus hard byte, per-field, and count caps, request framing validation, request content-encoding policy, default chunked request-body rejection with opt-in, default `Expect` rejection with opt-in `100-continue`, bounded `Range` request policy, default origin `Accept-Encoding` stripping with opt-in passthrough, connection-open rate caps, active connection caps, sharded `SO_REUSEPORT` accept sockets, in-flight upstream request caps, upstream connect timeout, path-shape-scoped passive upstream failure circuit breaker, per-connection request caps, request and upstream response header byte/field/count caps, framing validation, and timeouts, default-stripped HTTP trailers with opt-in capped forwarding, request/upstream body recent-window minimum data-rate guards, request body guardrails, and upstream response body guardrails.
- Rate-limited admin health checks and token-protected Prometheus metrics.
- Raw TCP proxy with per-client-prefix and global connection-rate limits, global/per-client-prefix concurrent-connection caps, sharded `SO_REUSEPORT` accept sockets, outbound connect timeout, idle timeout, optional per-direction minimum data-rate guard, and max connection duration.
- Runtime `RLIMIT_NOFILE` preflight and capacity validation so configured connection caps are backed by an explicit file-descriptor floor.
- Config preflight that rejects oversized/non-regular/malformed config inputs and out-of-range DDoS-critical knobs (rate caps, resource ceilings, header/body/trailer/metadata caps, timeouts, connection lifetimes, event-log and adaptive-window and filter-TTL bounds, circuit settings, method/Host allowlists, trusted-proxy and admin control-plane settings) so unsafe values fail startup instead of silently disabling protection; `0` remains the explicit per-rate-bucket disable value.
- SIGINT/SIGTERM shutdown handling so service-manager stops enter the same listener-drain path as Ctrl-C.
- Static JSON filters for known bad HTTP patterns, plus bounded and validated static/runtime filter rules with compiled header/user-agent match data and snapshot-based rule evaluation on the request path.
- Static JSON filters for known bad HTTP patterns, plus bounded and validated static/runtime filter rules with response-header-safe rule IDs, compiled header/user-agent match data, and snapshot-based rule evaluation on the request path.
- Adaptive learned filters that stay dormant, activate during matching floods through rolling token-bucket counters, reclaim idle signature/path-shape windows under capacity pressure, preserve recent evidence, and stop admitting fresh detector keys when a shard is full of recent windows.
- JSONL attack event logs for offline/nearline analysis, with bounded user-controlled fields, a bounded nonblocking queue capped at `8192` owned events, worker-side JSON serialization, bounded flush cadence, and byte/backup-count-capped rotation.
- Optional CodexSDGate analyzer that converts attack logs into constrained adaptive filter rules using either a subscription agent CLI you already logged into (Codex, Claude, OpenCode, Cursor, Grok — wrapped the way T3 Code does) or an API key (OpenAI, Anthropic, Gemini, OpenRouter).
Expand Down
Loading
Loading