mirror of https://github.com/MISP/misp-modules
Rename `files_iterator` and related variables to avoid overwriting `file_object` in virustotal enrichments
parent
7a0666b8af
commit
0f5532b2a1
|
@ -153,11 +153,11 @@ class VirusTotalParser:
|
||||||
('contacted_domains', 'communicates-with'),
|
('contacted_domains', 'communicates-with'),
|
||||||
('contacted_ips', 'communicates-with')
|
('contacted_ips', 'communicates-with')
|
||||||
]:
|
]:
|
||||||
files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
|
related_files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
|
||||||
for file in files_iterator:
|
for related_file in related_files_iterator:
|
||||||
file_object = self.create_misp_object(file)
|
related_file_object = self.create_misp_object(related_file)
|
||||||
file_object.add_reference(file_object.uuid, misp_name)
|
related_file_object.add_reference(file_object.uuid, misp_name)
|
||||||
self.misp_event.add_object(**file_object)
|
self.misp_event.add_object(**related_file_object)
|
||||||
|
|
||||||
self.misp_event.add_object(**file_object)
|
self.misp_event.add_object(**file_object)
|
||||||
return file_object.uuid
|
return file_object.uuid
|
||||||
|
|
|
@ -138,11 +138,11 @@ class VirusTotalParser:
|
||||||
('contacted_domains', 'communicates-with'),
|
('contacted_domains', 'communicates-with'),
|
||||||
('contacted_ips', 'communicates-with')
|
('contacted_ips', 'communicates-with')
|
||||||
]:
|
]:
|
||||||
files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
|
related_files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
|
||||||
for file in files_iterator:
|
for related_file in related_files_iterator:
|
||||||
file_object = self.create_misp_object(file)
|
related_file_object = self.create_misp_object(related_file)
|
||||||
file_object.add_reference(file_object.uuid, misp_name)
|
related_file_object.add_reference(file_object.uuid, misp_name)
|
||||||
self.misp_event.add_object(**file_object)
|
self.misp_event.add_object(**related_file_object)
|
||||||
|
|
||||||
self.misp_event.add_object(**file_object)
|
self.misp_event.add_object(**file_object)
|
||||||
return file_object.uuid
|
return file_object.uuid
|
||||||
|
|
Loading…
Reference in New Issue