fix: Fixed unnecessary dictionary field call

- No longer necessary to go under 'Event' field
  since PyMISP does not contain it since the
  latest update
pull/326/head
chrisr3d 3 years ago
parent 5bf35041cc
commit 0b603fc5d3
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
  1. 2
      misp_modules/lib/joe_parser.py
  2. 2
      misp_modules/modules/expansion/cve_advanced.py
  3. 2
      misp_modules/modules/expansion/urlhaus.py
  4. 2
      misp_modules/modules/expansion/virustotal.py
  5. 2
      misp_modules/modules/expansion/virustotal_public.py
  6. 2
      misp_modules/modules/import_mod/csvimport.py

@ -405,7 +405,7 @@ class JoeParser():
def finalize_results(self):
if self.references:
self.build_references()
event = json.loads(self.misp_event.to_json())['Event']
event = json.loads(self.misp_event.to_json())
self.results = {key: event[key] for key in ('Attribute', 'Object', 'Tag') if (key in event and event[key])}
@staticmethod

@ -31,7 +31,7 @@ class VulnerabilityParser():
def get_result(self):
if self.references:
self.__build_references()
event = json.loads(self.misp_event.to_json())['Event']
event = json.loads(self.misp_event.to_json())
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
return {'results': results}

@ -31,7 +31,7 @@ class URLhaus():
return vt_object
def get_result(self):
event = json.loads(self.misp_event.to_json())['Event']
event = json.loads(self.misp_event.to_json())
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
return {'results': results}

@ -35,7 +35,7 @@ class VirusTotalParser(object):
return self.input_types_mapping[self.attribute.type](self.attribute.value, recurse=True)
def get_result(self):
event = json.loads(self.misp_event.to_json())['Event']
event = json.loads(self.misp_event.to_json())
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
return {'results': results}

@ -23,7 +23,7 @@ class VirusTotalParser():
self.apikey = apikey
def get_result(self):
event = json.loads(self.misp_event.to_json())['Event']
event = json.loads(self.misp_event.to_json())
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
return {'results': results}

@ -194,7 +194,7 @@ class CsvParser():
return list2pop, misp, list(reversed(head))
def finalize_results(self):
event = json.loads(self.misp_event.to_json())['Event']
event = json.loads(self.misp_event.to_json())
self.results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}

Loading…
Cancel
Save