{# F32 + R87.2 + R87.2b (Hani #1 2026-11-19, "only one rule should be able to do this task"): ONE rule, Network campaigns. It catches every /24 from which many addresses attacked (5+ in 7 days by default) or never answered your servers (10+ in a day), lists them inside it with their attacks, country, AS and holder, and - once switched on with the password - blocks each at the routers' raw table by itself. `netrule` (the rule), `netcaught` (the networks) #} {% if netrule and netcaught %}{% set waiting = netcaught|selectattr('state', 'equalto', 'proposed')|list %}{% set blocked = netcaught|selectattr('state', 'equalto', 'approved')|list %}

{{ fresh_tag("rules:network-rule") }}Network campaigns rule: {{ {'on': 'on', 'off': 'off', 'waiting': 'waiting for approval'}[netrule.state] }} · {{ waiting|length }} network{{ '' if waiting|length == 1 else 's' }} waiting, {{ blocked|length }} blocked.

One rule for every attacking network. When {{ netrule.min_addresses }} or more different addresses of one /24 attack you within 7 days (blocked, an attack verdict, confirmed by the local AI), or 10 never answer your servers within a day (a SYN flood), the rule catches the whole /24. A network that attacked on 3 or more different days in the last 30 (network memory) is caught at 3 addresses - except home-internet and mobile networks. Blocking address by address does not work - they rotate. The network's AS is shown, never blocked. Networks with your own, inventory or trusted addresses are never caught.

Network campaigns

IF {{ netrule.min_addresses }} or more addresses of one /24 attack within 7 days (or 10 never answer your servers within a day) THEN block the whole /24 at the routers' raw table.

{{ {'on': 'On', 'off': 'Off', 'waiting': 'Waiting for approval'}[netrule.state] }} {{ waiting|length }} waiting · {{ blocked|length }} blocked{% if netrule.decided_by and netrule.state != 'waiting' %} · {{ 'switched on' if netrule.state == 'on' else 'switched off' }} by {{ netrule.decided_by }} {{ (netrule.decided_at or '')[:16]|replace('T', ' ') }} UTC{% endif %}

{% if admin %}
{% if netrule.state == 'on' %}{% else %}{% endif %}

On: blocks by itself.

Switched on, the rule blocks every network it catches by itself within 5 minutes; unblock one any time under Settings › Security events › Blocked addresses. Switched off, it keeps listing what it catches.
{% endif %}
{% for p in netcaught %}{% endfor %}
NetworkAddressesAttacksAI verdictKindSeen beforeCountryAS and holderStateActions
{{ p.network }} {{ p.peers }} {% set kinds = p.attacks|list %}{% if kinds|length > 1 %}
{{ kinds[0] }} +{{ kinds|length - 1 }}
    {% for a, n in p.attacks.items() %}
  • {{ a }} ({{ n }})
  • {% endfor %}
{% if p.sources %}

Evidence: {% for src, n in p.sources.items() %}{{ {'blocked': 'blocked', 'verdict': 'attack verdict', 'ai': 'local AI confirmed', 'half_open': 'never answered'}.get(src, src) }} {{ n }}{{ ', ' if not loop.last }}{% endfor %}

{% endif %}
{% elif kinds %}{{ kinds[0] }}{% else %}attacks{% endif %}
{{ fresh_tag("rules:network-ai") if loop.first }}{% if p.ai_state in ('agreed', 'review') %}{{ p.ai_attack_type }}{{ p.ai_reason or 'No reason given.' }}
From the lines of {{ p.ai_addresses or 0 }} of its addresses · {{ 'the two models agreed' if p.ai_state == 'agreed' else 'the models did not agree' }} · {{ (p.ai_at or '')[:16]|replace('T', ' ') }} UTC. Advice only: nothing is blocked from it.
{{ (p.ai_risk or 'none')|capitalize }}{% elif p.ai_state in ('queued', 'analysing') %}{% elif p.ai_state == 'failed' %}{% else %}{% endif %}
{{ fresh_tag("rules:network-kind") if loop.first }}{% if p.ai_kind_state == 'agreed' and p.ai_kind %}{{ p.ai_kind }}{{ p.ai_kind_reason or 'No reason given.' }}
Both local AI models named this kind · {{ (p.ai_kind_at or '')[:16]|replace('T', ' ') }} UTC. Advice only: nothing is blocked from it.
{% if p.ai_kind in ('Home internet', 'Mobile carrier') %} Households{% endif %}{% elif p.ai_kind_state == 'review' %}{% elif p.ai_kind_state in ('queued', 'analysing') %}{% elif p.ai_kind_state == 'failed' %}{% elif not (p.asn or p.holder) %}{% else %}{% endif %}
{{ fresh_tag("security:network-memory") if loop.first }}{% if p.seen_days %}{{ p.seen_days }} day{{ '' if p.seen_days == 1 else 's' }}{% else %}{% endif %} {{ p.country or '' }} {{ fresh_tag("rules:network-owner") if loop.first }}{% if p.asn %}AS{{ p.asn }}{% if p.as_name %} {{ p.as_name }}{% endif %}{% endif %}{% if p.holder %}
{{ p.holder }}{% endif %}
{% if p.state == 'proposed' %}Waiting{% elif p.state == 'approved' %}Blocked{% else %}Excluded{% endif %} {% if admin and p.state == 'proposed' %}
{% elif p.state == 'approved' %}Unblock…{% endif %}
{% endif %}