mirror of https://github.com/MISP/misp-modules
fix: Avoiding adding attributes that are already in the event
parent
33181bc52b
commit
cdf2f434ce
|
@ -34,7 +34,9 @@ class VirusTotalRequest(object):
|
|||
'authentihash': 'authentihash', 'ITW_urls': 'url'}
|
||||
|
||||
def parse_request(self, q):
|
||||
req_values = set()
|
||||
for attribute_type, attribute_value in q.items():
|
||||
req_values.add(attribute_value)
|
||||
try:
|
||||
error = self.input_types_mapping[attribute_type](attribute_value)
|
||||
except KeyError:
|
||||
|
@ -42,6 +44,8 @@ class VirusTotalRequest(object):
|
|||
if error is not None:
|
||||
return error
|
||||
for key, values in self.results.items():
|
||||
values = values.difference(req_values)
|
||||
if values:
|
||||
if isinstance(key, tuple):
|
||||
types, comment = key
|
||||
self.to_return.append({'types': list(types), 'values': list(values), 'comment': comment})
|
||||
|
|
Loading…
Reference in New Issue