C2b-1: FlowSpec auto-mitigation core #87
No reviewers
Labels
No labels
bug
deploy
documentation
duplicate
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/blackwall!87
Loading…
Reference in a new issue
No description provided.
Delete branch "sp-c-m2b1-flowspec-core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #86. First increment of C2b — turns a detection into the right mitigation automatically, building on C2a's FlowSpec codec.
What lands
blackwall-flow::select): from a detection'sproto+top_ports, when a small set of flows (≤max_flows) carries ≥concentrationof the attack → FlowSpec drop rules (drop UDP dport 53 → victim/32, victim's other services stay up); otherwise (diffuse, no ports, no proto) → RTBH whole-IP blackhole. Fully unit-tested incl. the single-100%-port and cap-break boundaries.FlowSpecController+FlowSpecManager(blackwall-rtbh): the FlowSpec analogues of the shipped RTBH controller/manager, reusing every invariant — eligibility (own-prefix only), concurrent-rule cap, hold-down + deferred-withdraw + TTL, per-entry origin (Manual never auto-cleared), single-owner task, mirror self-heal (journal-failure keeps the rule live; BGP-failure never journals a phantom). TheBgpExecutortrait gainsannounce_flowspec/withdraw_flowspec; both managers share one iBGP session.SelectorSink: routes eachOpenedto the chosen manager, broadcastsUpdated/Clearedto both (idempotent).flowspec-auto-birdlab gate: a concentrated synthetic detection auto-installs a FlowSpec rule in real BIRD2'sflow4tab(full matchdst 203.0.113.7/32; proto 17; dport 53); a diffuse one auto-installs an RTBH/32blackhole (community65535:666) — both auto-mitigation paths proven end to end via the realselect().Verification
cargo fmt --all --check,cargo clippy --workspace --all-targets -- --deny warnings,cargo docall clean.DATABASE_URL=… cargo test --workspacegreen;bash scripts/coverage.shexit 0 at 95.25% (flowspec_controller 99.30%, flowspec_manager 97.66%).flowspec-auto-birdgate passes 3× stably against BIRD 2.17.1 (both paths).Deferred to C2b-2 (follow-on)
Postgres persistence (
0005flowspec tables + Store +FlowSpecJournalimpl), theflowspecconfig directive, theblackwalld flowspecoperator CLI, and the daemonflowwiring of both managers + restart/reconcile.🤖 Generated with Claude Code