Skip to content

feat(nmap): Import-NmapScan IPv6 hosts (#63) - #69

Merged
jacobyoby merged 1 commit into
mainfrom
cursor/nmap-import-ipv6-afea
Sep 9, 2026
Merged

jacobyoby merged 1 commit into
mainfrom
cursor/nmap-import-ipv6-afea

Conversation

@jacobyoby

Copy link
Copy Markdown
Owner

Closes #63.

Import-NmapScan previously ignored every nmap address that was not addrtype='ipv4', so IPv6-only and dual-stack -oX scans dropped live hosts.

Approach (single-node identity): one topology node per nmap host. Prefer IPv4 when both families are present; emit IPv6 only when no IPv4 address is on that host. Addresses are validated with [System.Net.IPAddress]::Parse and stored in canonical form. Malformed addresses are skipped, matching the existing invalid-IPv4 behavior.

Changes

  • Accept addrtype='ipv6' when no IPv4 address is present
  • Prefer IPv4 on dual-stack hosts
  • Comment-based help documents IPv4/IPv6 address elements
  • Fixture tests/fixtures/nmap-sample-ipv6.xml plus Pester coverage
  • Brief README / changelog notes

Tests

  • Existing IPv4 fixture: still 2 up hosts; down 192.168.1.99 dropped
  • IPv6-only up host 2001:db8::10 imported
  • Dual-stack host emits 192.168.1.30, not 2001:db8::30
  • Down IPv6 host and malformed not-an-ip skipped
  • Get-Help Import-NmapScan DESCRIPTION mentions IPv4 and IPv6

Do not merge.

Open in Web Open in Cursor 

Accept addrtype=ipv6 when a host has no IPv4 address. Dual-stack hosts
keep a single node identity by preferring IPv4. Add fixture coverage
and document the preference in help, README, and changelog.

Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
@jacobyoby
jacobyoby marked this pull request as ready for review September 9, 2026 19:25
@jacobyoby
jacobyoby merged commit d70b432 into main Sep 9, 2026
7 checks passed
@jacobyoby
jacobyoby deleted the cursor/nmap-import-ipv6-afea branch September 9, 2026 19:26
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.

Import-NmapScan: include IPv6 hosts from nmap XML

2 participants