feat(ranges): enforce LAPI range decisions in an agent-owned nft table #6

Merged
patrick merged 1 commits from feat/range-enforcement into main 2026-10-23 13:56:00 +00:00
Owner

crowdsec-firewall-bouncer's nftables mode strips the prefix from Range
decisions and bans only the network address, so a /24 decision blocked
a single IP. With ranges.enabled, every audit now syncs range decisions
into a dedicated inet crowdsec-ranges table (interval+timeout sets with
input/forward drop chains) in one atomic nft -f transaction, then reads
it back to confirm each range is enforced.

  • element timeouts track each decision's remaining lifetime; stale
    elements are removed and extended decisions refreshed
  • ranges nested in another active range are covered, not inserted
  • ranges broader than min_prefix_v4/v6 (default /16, /32) are refused
  • ranges still missing after the sync stay in unenforceable_ranges, so
    the node reports DEGRADED rather than HEALTHY
  • the bouncer-set scan normalizes nft prefix elements to addr/len
    instead of failing the table scan on them
  • doctor checks the range table; the audit log line says when a synced
    node is degraded

Disabled by default.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

crowdsec-firewall-bouncer's nftables mode strips the prefix from Range decisions and bans only the network address, so a /24 decision blocked a single IP. With ranges.enabled, every audit now syncs range decisions into a dedicated `inet crowdsec-ranges` table (interval+timeout sets with input/forward drop chains) in one atomic `nft -f` transaction, then reads it back to confirm each range is enforced. - element timeouts track each decision's remaining lifetime; stale elements are removed and extended decisions refreshed - ranges nested in another active range are covered, not inserted - ranges broader than min_prefix_v4/v6 (default /16, /32) are refused - ranges still missing after the sync stay in unenforceable_ranges, so the node reports DEGRADED rather than HEALTHY - the bouncer-set scan normalizes nft prefix elements to addr/len instead of failing the table scan on them - doctor checks the range table; the audit log line says when a synced node is degraded Disabled by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrick added 1 commit 2026-10-23 13:55:18 +00:00
feat(ranges): enforce LAPI range decisions in an agent-owned nft table
CI / Unit tests (push) Successful in 9s
CI / Unit tests (pull_request) Successful in 6s
7156cfd4fe
crowdsec-firewall-bouncer's nftables mode strips the prefix from Range
decisions and bans only the network address, so a /24 decision blocked
a single IP. With ranges.enabled, every audit now syncs range decisions
into a dedicated `inet crowdsec-ranges` table (interval+timeout sets with
input/forward drop chains) in one atomic `nft -f` transaction, then reads
it back to confirm each range is enforced.

- element timeouts track each decision's remaining lifetime; stale
  elements are removed and extended decisions refreshed
- ranges nested in another active range are covered, not inserted
- ranges broader than min_prefix_v4/v6 (default /16, /32) are refused
- ranges still missing after the sync stay in unenforceable_ranges, so
  the node reports DEGRADED rather than HEALTHY
- the bouncer-set scan normalizes nft prefix elements to addr/len
  instead of failing the table scan on them
- doctor checks the range table; the audit log line says when a synced
  node is degraded

Disabled by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrick merged commit 6cb7fae06a into main 2026-10-23 13:56:00 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: patrick/threat-engine-agent#6