Files
EvoFirewall/packages/db/migrations/009_agent_ip_block_stats.sql
T
Denozordec 4ee78032c4
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m51s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped
feat(api, web): implement per-IP blocked stats for agents
- Added functionality to report per-IP drop counters in the `evofw-firewall.sh` script, capturing the top 200 IPs with packet counts.
- Introduced new API endpoints to retrieve blocked IP statistics and reset these stats for agents, enhancing monitoring capabilities.
- Updated the agent detail view to display blocked IPs, improving user visibility into agent performance.
- Enhanced database schema and repositories to support the storage and management of IP block statistics.

These changes provide a comprehensive view of blocked IPs, improving the overall management and monitoring of agents.
2026-08-07 14:15:10 +07:00

17 lines
714 B
SQL

-- Per-IP/CIDR drop counters from Linux agent nft/ipset element counters.
CREATE TABLE IF NOT EXISTS agent_ip_block_stats (
id TEXT PRIMARY KEY NOT NULL,
agent_id TEXT NOT NULL REFERENCES agents(id) ON DELETE CASCADE,
ip TEXT NOT NULL,
packets INTEGER NOT NULL DEFAULT 0,
last_reported_packets INTEGER NOT NULL DEFAULT 0,
first_seen_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
last_seen_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_agent_ip_block_stats_agent_ip
ON agent_ip_block_stats(agent_id, ip);
CREATE INDEX IF NOT EXISTS idx_agent_ip_block_stats_agent_packets
ON agent_ip_block_stats(agent_id, packets);