DECENTRALIZED THREAT GOSSIP & KERNEL DROPS

Hackergate incorporates a distributed peer-to-peer threat intelligence bus. When an attacker probes an endpoint in Frankfurt, the incident is authenticated and gossiped across multi-region edge gateways in sub-50 nanoseconds, immunizing Tokyo and Virginia before the adversary rotates targets.

P2P Mesh Architecture vs Centralized SIEM

Traditional web application firewalls rely on centralized databases (Redis, Postgres, or cloud APIs) to share IP reputation. Under high volumetric attack, the database connection pool exhausts or creates regional latency penalties. Hackergate uses a pure decentralized gossip topology with zero single points of failure.

MULTI-REGION GOSSIP SYNCHRONIZATION TOPOLOGY
[ Attacker Probe ] ───► Frankfurt Edge (edge-fra-01) │ ├─► Evaluates Coraza CRS v4 (Score: 25 -> Ban IP) ├─► Pushes IP to Local nftables Kernel Set (<50ns) │ ▼ Generates UUIDv7 Event & Computes HMAC-SHA256 [ Threat Gossip Wire Protocol v2 ] │ ┌──────────────┴──────────────┐ ▼ ▼ Virginia Edge (edge-iad-01) Tokyo Edge (edge-tok-01) │ │ • Validates HMAC signature • Validates HMAC signature • Checks Bloom Filter dedupe • Checks Bloom Filter dedupe • Injects into local nftables • Injects into local nftables │ │ ▼ ▼ [ Packets Dropped at Kernel ] [ Packets Dropped at Kernel ]

Wire Protocol v2 Specification

Nodes exchange threat intelligence over mutual TLS or HTTPS endpoints (POST /__hg/gossip). Each transmission is signed using an HMAC-SHA256 pre-shared cluster key.

GOSSIP PAYLOAD SCHEMA (POST /__hg/gossip)
{ "event_id": "018db26f-9e4a-7bc1-b4f2-a4e98f12a345", "origin_node": "edge-fra-01.prod", "timestamp": 1794219000, "action": "ban_ip", "target": "198.51.100.42", "cidr_prefix": 32, "ttl_seconds": 86400, "reason": "owasp_crs_sqli_repeat_offender", "evidence": { "rule_id": 942100, "anomaly_score": 25, "request_id": "req_88f91a2bc" } }
Field NameTypeDescription
event_idUUIDv7 StringTime-ordered 128-bit unique identifier used for millisecond deduplication in bloom filter.
origin_nodeStringCanonical identifier of the edge node that first detected the attack vector.
timestampUnix TimestampEpoch timestamp in seconds. Replayed events older than clock skew tolerance (30s) are dropped.
actionEnumban_ip (single IP), ban_cidr (subnet block), pow_enforce (force browser puzzle), unban.
targetIP / CIDRIPv4 or IPv6 target string (e.g. 198.51.100.42 or 2001:db8::/32).
ttl_secondsIntegerLifespan of the quarantine. Automatically evicted upon expiration.
reasonStringMachine-readable threat classification (e.g. owasp_crs_sqli, bola_scanning, fake_googlebot).

Defensive & Anti-Poisoning Guarantees

Because security events dictate firewall behavior, Hackergate incorporates rigorous cryptographic and algorithmic safeguards against cache poisoning and denial-of-service attempts.

Zero-Allocation HMAC Validation

Packets missing the X-Hackergate-Signature or providing an invalid MAC are discarded in the socket read buffer with zero memory allocations, neutralizing gossip endpoint flood attacks.

Probabilistic Bloom Filter

A 1MB in-memory counting bloom filter tracks recent event_id UUIDs. Repeated gossip loops and duplicate peer broadcasts are discarded in sub-10 nanoseconds without acquiring mutex locks.

Lock-Free Ring Buffer

Outbound gossip notifications pass through a 65,536-slot lock-free circular ring buffer. If a peer goes offline, backpressure does not slow down reverse proxy request throughput.

Configuring Mesh Gossip in hackergate.toml

Cluster mesh settings are defined in the global /etc/hackergate/hackergate.toml configuration file.

/etc/hackergate/hackergate.toml [mesh]
[mesh] enabled = true node_id = "edge-fra-01.prod" bind_addr = "0.0.0.0:8088" secret_key = "env:HACKERGATE_MESH_SECRET" # Mesh peers to synchronize with across data centers: peers = [ "https://edge-iad-01.internal:8088", "https://edge-sin-01.internal:8088", "https://edge-tok-01.internal:8088" ] gossip_interval = "500ms" ring_buffer_capacity = 65536 bloom_filter_bits = 1048576 [nftables] enabled = true table_name = "hackergate_filter" ipv4_set = "hg_banned_ipv4" ipv6_set = "hg_banned_ipv6" sync_interval = "100ms"

Hardware-Level Kernel Offloading via Linux nftables

Handling banned IPs inside userspace consumes CPU cycles for TCP handshakes and TLS negotiations. Hackergate integrates directly with the Linux kernel nftables subsystem via Netlink sockets.

/etc/nftables.conf
# /etc/nftables.conf table inet hackergate_filter { set hg_banned_ipv4 { type ipv4_addr flags timeout } set hg_banned_ipv6 { type ipv6_addr flags timeout } chain prerouting { type filter hook prerouting priority -300; policy accept; # Drop packets immediately before TCP handshake: ip saddr @hg_banned_ipv4 counter drop ip6 saddr @hg_banned_ipv6 counter drop } }

When Hackergate bans an IP, it issues an atomic Netlink command adding the address to @hg_banned_ipv4 with the specified timeout flag. Subsequent packets from that source IP are discarded directly inside the Linux network driver before entering the TCP stack.

← PREV: CORAZA WAF & CRS v4NEXT: BOT DEFENSE & BROWSER PoW →