20aa0cd8c0
CRITICAL BUG FIX: Added is_valid_ip() function that was being called by blocking functions but didn't exist, causing all IP blocks to fail with "command not found" error. THE PROBLEM: live-attack-monitor.sh line 813 calls is_valid_ip() to validate IP format before blocking, but the function was never implemented, causing: ``` is_valid_ip: command not found ✗ Error: Invalid IP format: 172.245.177.148 ``` THE FIX: Implemented is_valid_ip() in lib/attack-patterns.sh with: - IPv4 validation with octet range checking (0-255) - IPv6 validation (basic format checking) - Returns 0 for valid IPs, 1 for invalid - Exported for use across all scripts VALIDATION: - IPv4: 172.245.177.148 ✓ Valid - IPv4 invalid: 999.999.999.999 ✓ Rejected - IPv6: 2001:db8::1 ✓ Valid IMPACT: - IP blocking now works correctly - Blocks from live-attack-monitor menu functional - Prevents invalid IP formats from being passed to CSF/iptables FILES CHANGED: - lib/attack-patterns.sh: Added is_valid_ip() function + export