-
Notifications
You must be signed in to change notification settings - Fork 2
/
QueryExample.txt
82 lines (59 loc) · 1.8 KB
/
QueryExample.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Some Useful Query
EC2
//EC2 Analisi
MATCH (n:AWSEC2) where n.InstanceId = "xxxxxxxxxx"
RETURN n
//EC2 with ssh open to any
MATCH (i)-[:In]->(n:PortRange)-[:PortRangeSG]->(p)-[:SGAttachment]->(r) where n.Name = "From22To22" and i.CidrIp = "0.0.0.0/0"
return n, i,p,r
//Firewall EC2
MATCH p= ()-[:PortRangeSG]->()-[:SGAttachment]->(n:AWSEC2)
where n.InstanceId = "xxxxxxxxxxxxxxxxx"
RETURN p
NETWORK
// Since Peering
MATCH p=()-[r:owner]->(f)<-[:geo]-()
where (f.Name <> "vpc-default" and f.Name <> "NoName")
RETURN p as name
union all
MATCH p=()-[:TransitGatewayAttachment]->()
RETURN p as name
union all match (v:VPNCustomerGateway)
return v as name
union all match pe = ()-[:Peering]-()
return pe as name
//Network Fino alle VPN
MATCH p=()-[r:owner]->(f)<-[:geo]-()
where (f.Name <> "vpc-default" and f.Name <> "NoName")
RETURN p as name
union all
MATCH p=()-[:TransitGatewayAttachment]->()
RETURN p as name
union all match (v:VPNCustomerGateway)
return v as name
// Since EC2
MATCH p=()-[r:owner]->(f)<-[:geo]-()
where (f.Name <> "vpc-default" and f.Name <> "NoName")
RETURN p as name
union all
MATCH p=()-[:TransitGatewayAttachment]->()
RETURN p as name
union all match (v:VPNCustomerGateway)
return v as name
union all match pe = ()-[:Peering]-()
return pe as name
union all match az = (f)-[:InZone|:Ec2Subnet]->() where (f.Name <> "vpc-default" and f.Name <> "NoName")
return az as name
// Since Subnet
MATCH p=()-[r:owner]->(f)<-[:geo]-()
where (f.Name <> "vpc-default" and f.Name <> "NoName")
RETURN p as name
union all
MATCH p=()-[:TransitGatewayAttachment]->()
RETURN p as name
union all match (v:VPNCustomerGateway)
return v as name
union all match pe = ()-[:Peering]-()
return pe as name
union all match az = (f)-[:InZone]->() where (f.Name <> "vpc-default" and f.Name <> "NoName")
return az as name