feat: detect and display source IPs of port scans#54
Conversation
When a port scan is detected, the app now attempts to identify the source IP address(es) by capturing active network connections using lsof. This addresses the issue where port scan alerts didn't show who was scanning. Implementation: - Added get_recent_connections() to capture active connections via lsof - Enhanced parse_portscan_events() to extract and display source IPs - Smart formatting: shows single IP, multiple IPs, or 'X more' notation - Falls back to '(source unknown)' if no connections are captured Fixes #12 Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
Code Review for PR #54: Detect and display source IPs of port scansThank you for implementing this feature! Overall, this is a solid implementation that addresses the issue well. Here are my findings: ✅ Strengths
🐛 Issues & Concerns1. Logic Bug in
|
|
@claude can you fix all the issues addressed in this review, we dont need IPv6 support, forget about that for now |
|
Claude finished @pirate's task —— View job • Fixed Issues from Code ReviewAll issues identified in the code review have been addressed (excluding IPv6 support as requested). Completed Tasks:
Changes Made
These fixes improve the robustness and correctness of the port scan detection feature without changing its core functionality. |
Fixes #12
Enhances port scan detection to identify and display the source IP address(es) when a scan is detected.
Changes
get_recent_connections()function to capture active network connections usinglsofparse_portscan_events()to extract and display source IPsImplementation
The solution addresses the timing challenge by capturing a snapshot of all active connections at the moment the kernel detects port scan rate limiting. While port scans are rapid and may not always leave connections open long enough, this approach maximizes the chances of identifying the scanner.
Generated with Claude Code) | View branch | [View job run](https://github.com/pirate/security-growler/actions/runs/19909355036