forked from p15670423/monkey
* Added the boto3 pckg to the right req'.txt file
* Added a safe dict key access for aws_instance_id in report.py * Added a skip in the aws_export if there is no instance_id in the issue.
This commit is contained in:
parent
e8c604d7c5
commit
2f1240cc0e
|
@ -26,7 +26,8 @@ class AWSExporter(Exporter):
|
||||||
return True
|
return True
|
||||||
for machine in issues_list:
|
for machine in issues_list:
|
||||||
for issue in issues_list[machine]:
|
for issue in issues_list[machine]:
|
||||||
findings_list.append(AWSExporter._prepare_finding(issue))
|
if not issue.get('aws_instance_id', None):
|
||||||
|
findings_list.append(AWSExporter._prepare_finding(issue))
|
||||||
|
|
||||||
if not AWSExporter._send_findings(findings_list, AWSExporter._get_aws_keys()):
|
if not AWSExporter._send_findings(findings_list, AWSExporter._get_aws_keys()):
|
||||||
logger.error('Exporting findings to aws failed')
|
logger.error('Exporting findings to aws failed')
|
||||||
|
|
|
@ -553,7 +553,7 @@ class ReportService:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_machine_aws_instance_id(hostname):
|
def get_machine_aws_instance_id(hostname):
|
||||||
return str(list(mongo.db.monkey.find({'hostname': hostname}, {'aws_instance_id': 1}))[0]['aws_instance_id'])
|
return str(list(mongo.db.monkey.find({'hostname': hostname}, {'aws_instance_id': 1}))[0].get('aws_instance_id', None))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_issues():
|
def get_issues():
|
||||||
|
|
|
@ -14,4 +14,5 @@ netifaces
|
||||||
ipaddress
|
ipaddress
|
||||||
enum34
|
enum34
|
||||||
PyCrypto
|
PyCrypto
|
||||||
|
boto3
|
||||||
virtualenv
|
virtualenv
|
Loading…
Reference in New Issue