Skip to content

Commit df9415a

Browse files
authored
Merge pull request #377 from 0xdabbad00/add_icons_for_vpc_endpoints
Add icons for vpc endpoints
2 parents ffa4cd6 + 9fb9be8 commit df9415a

22 files changed

+1540
-15
lines changed

account-data/demo/us-east-1/ec2-describe-security-groups.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
{
22
"SecurityGroups": [
3+
{
4+
"IpPermissionsEgress": [
5+
{
6+
"IpProtocol": "-1",
7+
"PrefixListIds": [],
8+
"IpRanges": [
9+
{
10+
"CidrIp": "0.0.0.0/0"
11+
}
12+
],
13+
"UserIdGroupPairs": [],
14+
"Ipv6Ranges": []
15+
}
16+
],
17+
"Description": "Endpoint access",
18+
"IpPermissions": [
19+
{
20+
"PrefixListIds": [],
21+
"FromPort": 443,
22+
"IpRanges": [],
23+
"ToPort": 443,
24+
"IpProtocol": "tcp",
25+
"UserIdGroupPairs": [
26+
{
27+
"UserId": "123456789012",
28+
"GroupId": "sg-00000004"
29+
}
30+
],
31+
"Ipv6Ranges": []
32+
}
33+
],
34+
"GroupName": "Endpint",
35+
"VpcId": "vpc-12345678",
36+
"OwnerId": "123456789012",
37+
"GroupId": "sg-00000006"
38+
},
339
{
440
"IpPermissionsEgress": [
541
{
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"VpcEndpoints": [
3+
{
4+
"CreationTimestamp": "2019-04-11T18:59:11+00:00",
5+
"DnsEntries": [],
6+
"Groups": [],
7+
"NetworkInterfaceIds": [],
8+
"PolicyDocument": "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"*\",\"Resource\":\"*\"}]}",
9+
"PrivateDnsEnabled": false,
10+
"RouteTableIds": [
11+
"rtb-00000000"
12+
],
13+
"ServiceName": "com.amazonaws.us-east-1.s3",
14+
"State": "available",
15+
"SubnetIds": [],
16+
"VpcEndpointId": "vpce-00000000000000001",
17+
"VpcEndpointType": "Gateway",
18+
"VpcId": "vpc-12345678"
19+
},
20+
{
21+
"CreationTimestamp": "2019-04-30T15:19:35+00:00",
22+
"DnsEntries": [
23+
{
24+
"DnsName": "vpce-05ed16ac73726e737-5xkr9dae-us-east-1f.sqs.us-east-1.vpce.amazonaws.com",
25+
"HostedZoneId": "Z7HUB22UULQXV"
26+
},
27+
{
28+
"DnsName": "sqs.us-east-1.amazonaws.com",
29+
"HostedZoneId": "ZCYZV1JQU4VH2"
30+
}
31+
],
32+
"Groups": [
33+
{
34+
"GroupId": "sg-00000006",
35+
"GroupName": "default"
36+
}
37+
],
38+
"NetworkInterfaceIds": [
39+
"eni-00000000000000001"
40+
],
41+
"PolicyDocument": "{\n \"Statement\": [\n {\n \"Action\": \"*\",\n \"Effect\": \"Allow\",\n \"Resource\": \"*\",\n \"Principal\": \"*\"\n }\n ]\n}",
42+
"PrivateDnsEnabled": true,
43+
"RouteTableIds": [],
44+
"ServiceName": "com.amazonaws.us-east-1.sqs",
45+
"State": "available",
46+
"SubnetIds": [
47+
"subnet-00000003"
48+
],
49+
"VpcEndpointId": "vpce-00000000000000002",
50+
"VpcEndpointType": "Interface",
51+
"VpcId": "vpc-12345678"
52+
}
53+
]
54+
}

cloudmapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import importlib
3232
import commands
3333

34-
__version__ = "2.5.3"
34+
__version__ = "2.5.4"
3535

3636

3737
def show_help(commands):

commands/prepare.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,16 @@ def build_data_structure(account_data, config, outputfilter):
364364
cytoscape_json.append(vpc.cytoscape_data())
365365

366366
vpc_children_to_remove = set()
367-
for az in vpc.children:
368-
if az.has_leaves:
367+
for vpc_child in vpc.children:
368+
if vpc_child.has_leaves:
369369
if outputfilter["azs"]:
370-
cytoscape_json.append(az.cytoscape_data())
370+
cytoscape_json.append(vpc_child.cytoscape_data())
371+
elif vpc_child.node_type != 'az':
372+
# Add VPC children that are not AZs, such as Gateway endpoints
373+
cytoscape_json.append(vpc_child.cytoscape_data())
371374

372375
az_children_to_remove = set()
373-
for subnet in az.children:
376+
for subnet in vpc_child.children:
374377
if subnet.has_leaves:
375378
cytoscape_json.append(subnet.cytoscape_data())
376379

@@ -379,7 +382,7 @@ def build_data_structure(account_data, config, outputfilter):
379382
else:
380383
az_children_to_remove.add(subnet)
381384
for subnet in az_children_to_remove:
382-
az.removeChild(subnet)
385+
vpc_child.removeChild(subnet)
383386

384387
else:
385388
vpc_children_to_remove.add(az)

shared/nodes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,9 @@ def __init__(self, parent, json_blob):
557557
# Access is controlled through their policy, or the S3 bucket policies, or somewhere else.
558558
self._unrestricted_ingress = True
559559

560-
if self._name == 's3':
561-
self._type = 's3'
562-
elif self._name == 'dynamodb':
563-
self._type = 'dynamodb'
560+
services_with_icons = ['s3', 'dynamodb', 'kinesis', 'sqs', 'sns', 'codebuild', 'codecommit', 'codepipeline', 'ecs', 'ecr', 'ssm', 'secretsmanager', 'kms', 'apigateway']
561+
if self._name in services_with_icons:
562+
self._type = self._name
564563

565564
super(VpcEndpoint, self).__init__(self._parent, json_blob)
566565

tests/unit/test_prepare.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_build_data_structure(self):
7373

7474
# Now check it
7575
# Check number of connections
76-
assert_equal(17, len(pyjq.all('.[].data|select(.type == "edge")|keys', cytoscape_json)))
76+
assert_equal(25, len(pyjq.all('.[].data|select(.type == "edge")|keys', cytoscape_json)))
7777

7878
# Check number of nodes
7979
assert_equal(2, len(pyjq.all('.[].data|select(.type == "ip")|keys', cytoscape_json)))
@@ -84,3 +84,5 @@ def test_build_data_structure(self):
8484
assert_equal(4, len(pyjq.all('.[].data|select(.type == "subnet")|keys', cytoscape_json)))
8585
assert_equal(1, len(pyjq.all('.[].data|select(.type == "region")|keys', cytoscape_json)))
8686
assert_equal(1, len(pyjq.all('.[].data|select(.type == "vpc")|keys', cytoscape_json)))
87+
assert_equal(1, len(pyjq.all('.[].data|select(.type == "sqs")|keys', cytoscape_json)))
88+
assert_equal(1, len(pyjq.all('.[].data|select(.type == "s3")|keys', cytoscape_json)))

web/icons/aws/apigateway.svg

Lines changed: 108 additions & 0 deletions
Loading

web/icons/aws/codebuild.svg

Lines changed: 93 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)