Skip to content

inventory-map.graphml

Section 16 · From docs/INVENTORY_REFERENCE.md on GitHub

The same graph as GraphML (NetworkX write_graphml_xml), for Gephi, yEd, Neo4j import or networkx.read_graphml.

Node attributes: name, asset_type, provider, region, arn, account_id, tags (the tag dictionary as a JSON string), is_internet_exposed (boolean). External endpoint nodes have name, asset_type="EXTERNAL", provider="EXTERNAL", is_external=true.

Edge attributes: edge_type, relationship, description, direction, protocol, port_range, cidr (empty strings when unset). Parallel rule edges are merged exactly as in section 15, so a merged edge's port_range, protocol and description can hold comma- or semicolon-separated lists.

import networkx as nx

g = nx.read_graphml("reports/inventory-map.graphml")
exposed = [d["name"] for _, d in g.nodes(data=True) if d.get("is_internet_exposed")]