Skip to content

feat: Support multiple IPs per hostname in ScanTarget #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 23, 2025

Summary

  • Enhanced ScanTarget to support multiple IP addresses per hostname
  • Implemented backward-compatible solution maintaining existing API
  • Updated related components to handle multiple IPs correctly

Changes

  • Modified ScanTarget class to store multiple IPs in a List<String> field
  • Updated fromTargetString() method to resolve all IP addresses using InetAddress.getAllByName()
  • Maintained backward compatibility by keeping the existing ip field and marking getIp()/setIp() as deprecated
  • Updated DenylistFileProvider to check all IPs when evaluating denylists
  • Added MongoDB index for the new ips field to support efficient queries
  • Added comprehensive unit tests for both ScanTarget and DenylistFileProvider

Test Plan

  • Added unit tests for ScanTarget multiple IP functionality
  • Added unit tests for DenylistFileProvider with multiple IPs
  • All existing tests pass without modification
  • Manual testing with hostnames that resolve to multiple IPs

Fixes #11

- Changed ScanTarget to store multiple IP addresses in a List<String>
- Updated fromTargetString() to resolve all IPs using getAllByName()
- Maintained backward compatibility with deprecated getIp()/setIp() methods
- Updated DenylistFileProvider to check all IPs when evaluating denylists
- Added MongoDB index for the new ips field
- Added comprehensive unit tests for the new functionality

Fixes #11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple IPs per hostname in ScanTarget
1 participant