$ show dotX12/traffic-guard
TrafficGuard is a Go-based CLI utility for network security that blocks known port scanners by configuring iptables/ip6tables and ipset. It downloads lists of malicious IP subnets, creates ipset sets, and configures firewall rules to drop traffic from these addresses. The tool includes optional logging with aggregation, automatic persistence of firewall rules across reboots via systemd services, and a comprehensive uninstall mechanism. It features intelligent integration with UFW (Uncomplicated Firewall) when present, with safeguards to prevent SSH lockout.
The LLM identified 2 files worth highlighting for reuse:
Provides centralized command execution with comprehensive logging, multiple execution modes (normal, quiet, output capture), and proper error handling. Demonstrates non-obvious skill in balancing usability with diagnostic capabilities while maintaining loose coupling to the rest of the application.
Handles downloading subnet lists from URLs with automatic deduplication and IPv4/IPv6 separation. Shows craftsmanship in efficiently processing lists, avoiding duplicates, and cleanly separating IP versions while providing meaningful progress reporting and error handling.