Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Display function names in EC2 security group usage section (part of #204
Browse files Browse the repository at this point in the history
)
  • Loading branch information
l01cd3v committed Nov 6, 2017
1 parent ed001c6 commit 2d832fd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion AWSScout2/configs/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ def store_target(self, global_params, region, target):
target_dict[target_id] = target

id_map = {
'functions': 'FunctionName',
'peering_connections': 'VpcPeeringConnectionId',
'subnet_groups': 'DBSubnetGroupName'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ul>
{{#each resources}}
<li class="list-group-item-text"><a href="javascript:showObject('services.{{../service}}.regions.{{../region}}.vpcs.{{../vpc}}.{{../resource_type}}.{{this}}')">
{{get_value_at 'services' ../service 'regions' ../region 'vpcs' ../vpc ../resource_type this 'name'}}
{{get_value_at 'services' ../service 'regions' ../region 'vpcs' ../vpc ../resource_type this 'name'}} ({{this}})
</a></li>
{{/each}}
</ul>
Expand Down
2 changes: 2 additions & 0 deletions AWSScout2/output/data/inc-scout2/scout2.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ var make_title = function(title) {
return 'CloudTrail';
} else if (title == 'cloudwatch') {
return 'CloudWatch';
} else if (title == 'awslambda') {
return 'Lambda';
} else {
return (title.charAt(0).toUpperCase() + title.substr(1).toLowerCase()).replace('_', ' ');
}
Expand Down
6 changes: 5 additions & 1 deletion AWSScout2/rules/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ def match_security_groups_and_resources(aws_config):
go_to_and_do(aws_config, aws_config['services']['emr'], ['regions', 'vpcs', 'clusters'], ['services', 'emr'], match_security_groups_and_resources_callback, callback_args)
callback_args = {'status_path': ['Status', 'State'], 'sg_list_attribute_name': ['Ec2InstanceAttributes', 'EmrManagedSlaveSecurityGroup'], 'sg_id_attribute_name': ''}
go_to_and_do(aws_config, aws_config['services']['emr'], ['regions', 'vpcs', 'clusters'], ['services', 'emr'], match_security_groups_and_resources_callback, callback_args)
# Lambda functions
callback_args = {'status_path': ['Runtime'], 'sg_list_attribute_name': [ "VpcConfig", "SecurityGroupIds" ]}
go_to_and_do(aws_config, aws_config['services']['awslambda'], ['regions', 'functions'], ['services', 'awslambda'], match_security_groups_and_resources_callback, callback_args)




Expand All @@ -395,7 +399,7 @@ def match_security_groups_and_resources_callback(aws_config, current_config, pat
resource_type = resource_path[-2]
if 'status_path' in callback_args:
status_path = combine_paths(copy.deepcopy(original_resource_path), callback_args['status_path'])
resource_status = get_object_at(aws_config, status_path)
resource_status = get_object_at(aws_config, status_path).replace('.', '_')
else:
resource_status = None
unknown_vpc_id = True if current_path[4] != 'vpcs' else False
Expand Down
4 changes: 3 additions & 1 deletion AWSScout2/services/awslambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

class LambdaRegionConfig(RegionConfig):

pass
def parse_function(self, global_params, region, function):
function['name'] = function.pop('FunctionName')
self.functions[function['name']] = function



Expand Down

0 comments on commit 2d832fd

Please sign in to comment.