From 59f3ab177d55f99da4ff300057e6b738264b5e3b Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 5 Dec 2023 17:59:34 +0000 Subject: [PATCH] #1052 duplicate private networks report --- share/config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/share/config.yml b/share/config.yml index 53e2e6e6..b64f26c5 100644 --- a/share/config.yml +++ b/share/config.yml @@ -256,6 +256,26 @@ system_reports: GROUP BY ip, port HAVING count(vlan) > COALESCE(NULLIF(?,''), '1') ::integer ORDER BY vlans DESC, ip ASC, port ASC + - tag: duplicateprivatenetworks + category: Port + label: 'Duplicate Private Networks' + columns: + - { subnet: 'Subnet', _searchable: true } + - { count: 'Instances' } + - { seen: 'Where Seen' } + query: | + SELECT subnet, count(subnet), array_to_string(array_agg(host(alias)::text || ' on ' || host(ip)::text), ', ') AS seen + FROM device_ip + WHERE ip <> alias + AND (masklen(subnet) <> 32 AND masklen(subnet) <> 128) + AND (subnet << '10.0.0.0/8' + OR subnet << '172.16.0.0/12' + OR subnet << '192.168.0.0/16' + OR subnet << '100.64.0.0/10' + OR subnet << 'fd00::/8') + GROUP BY subnet + HAVING count(subnet) > 1 + ORDER BY subnet - tag: vlansonlyuplinks category: VLAN label: 'VLANs Only On Uplinks'