diff --git a/.idea/misc.xml b/.idea/misc.xml
index 0172830..98acd46 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/network-architecture-verification-and-validation.iml b/.idea/network-architecture-verification-and-validation.iml
index befceda..f6fdecd 100644
--- a/.idea/network-architecture-verification-and-validation.iml
+++ b/.idea/network-architecture-verification-and-validation.iml
@@ -2,9 +2,11 @@
+
+
-
+
diff --git a/src/navv/_version.py b/src/navv/_version.py
index a3fa2e1..fa7e08b 100644
--- a/src/navv/_version.py
+++ b/src/navv/_version.py
@@ -1,2 +1,2 @@
"""This file defines the version of this module."""
-__version__ = "3.3.1"
+__version__ = "3.3.2"
diff --git a/src/navv/spreadsheet_tools.py b/src/navv/spreadsheet_tools.py
index 29ac0d8..cf72d93 100644
--- a/src/navv/spreadsheet_tools.py
+++ b/src/navv/spreadsheet_tools.py
@@ -93,6 +93,8 @@ def get_inventory_data(ws, **kwargs):
ip=row[0].value,
name=row[1].value,
color=(copy(row[0].fill), copy(row[0].font)),
+ mac_address="",
+ vendor=""
)
return inventory
@@ -262,14 +264,17 @@ def handle_ip(ip_to_check, dns_data, inventory, segments, ext_IPs, unk_int_IPs):
* DHCP Broadcasting
* Multicast
* Within Segments identified
- * Within Inventory, not within an Identified Segment
+ * Resolution by DNS, then Inventory, and then Unknown
+ * Appends name if External IP
* Private Network
+ * Resolution by DNS, Inventory, then Unknown
* External (Public IP space) or Internet
+ * Resolution by DNS, Unknown
This will capture the name description and the color coding identified within the worksheet.
"""
segment_ips = [segment.network for segment in segments]
- desc_to_change = ("Unknown IP Address", IPV6_CELL_COLOR)
+ desc_to_change = ("Not Triggered IP", IPV6_CELL_COLOR)
if ip_to_check == str("0.0.0.0"):
desc_to_change = (
"Unassigned IPv4",
@@ -288,39 +293,42 @@ def handle_ip(ip_to_check, dns_data, inventory, segments, ext_IPs, unk_int_IPs):
IPV6_CELL_COLOR,
)
elif ip_to_check in segment_ips:
- for segment in segments[:-1]:
- if ip_to_check not in segment.network:
- continue
- elif ip_to_check in dns_data:
- desc_to_change = (dns_data[ip_to_check] , segment.color)
- elif ip_to_check in inventory:
- desc_to_change = (inventory[ip_to_check].name, segment.color)
- else:
+ for x in range(0, len(segments[:-1])):
+ if segments[x].network == ip_to_check:
+ if ip_to_check in dns_data:
+ resolution = dns_data[ip_to_check].name
+ elif ip_to_check in inventory:
+ resolution = inventory[ip_to_check].name
+ else:
+ resolution = f"Unknown device in {segments[x].name} network"
+ unk_int_IPs.add(ip_to_check)
+ if not netaddr.IPAddress(ip_to_check).is_private():
+ resolution = resolution + " {Non-Priv IP}"
desc_to_change = (
- f"Unknown device in {segment.name} network",
- segment.color,
- )
- unk_int_IPs.add(ip_to_check)
- elif ip_to_check in inventory:
- desc_to_change = (inventory[ip_to_check].name, inventory[ip_to_check].color)
+ resolution,
+ segments[x].color,
+ )
elif netaddr.IPAddress(ip_to_check).is_private():
if ip_to_check in dns_data:
desc_to_change = (dns_data[ip_to_check], INTERNAL_NETWORK_CELL_COLOR)
+ elif ip_to_check in inventory:
+ desc_to_change = (inventory[ip_to_check].name, INTERNAL_NETWORK_CELL_COLOR)
else:
desc_to_change = ("Unknown Internal address", INTERNAL_NETWORK_CELL_COLOR)
unk_int_IPs.add(ip_to_check)
else:
ext_IPs.add(ip_to_check)
- resolution = "Unresolved external address"
if ip_to_check in dns_data:
resolution = dns_data[ip_to_check]
+ elif ip_to_check in inventory:
+ resolution = inventory[ip_to_check].name + " {Non-Priv IP}"
else:
try:
resolution = socket.gethostbyaddr(ip_to_check)[0]
except socket.herror:
ALREADY_UNRESOLVED.append(ip_to_check)
finally:
- dns_data[ip_to_check] = resolution
+ resolution = "Unresolved external address"
desc_to_change = (resolution, EXTERNAL_NETWORK_CELL_COLOR)
return desc_to_change