Skip to content

Commit

Permalink
chg: [circl_passivedns] Using time_first & time_last as `first_se…
Browse files Browse the repository at this point in the history
…en` and `last_seen` fields on the `passive-dns` objects

- Should fix #692
  • Loading branch information
chrisr3d committed Sep 26, 2024
1 parent d2e322b commit 59c9946
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions misp_modules/modules/expansion/circl_passivedns.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,20 @@ def parse(self):
self.result = {'error': 'Not found'}
return

mapping = {'count': 'counter', 'origin': 'text',
'time_first': 'datetime', 'rrtype': 'text',
'rrname': 'text', 'rdata': 'text',
'time_last': 'datetime'}
mapping = {
'count': 'counter', 'origin': 'text', 'rrtype': 'text',
'rrname': 'text', 'rdata': 'text',
}
for result in results:
pdns_object = MISPObject('passive-dns')
for relation, attribute_type in mapping.items():
pdns_object.add_attribute(relation, type=attribute_type, value=result[relation])
pdns_object.add_attribute(relation, result[relation], type=attribute_type)
first_seen = result['time_first']
pdns_object.add_attribute('time_first', first_seen, type='datetime')
pdns_object.first_seen = first_seen
last_seen = result['time_last']
pdns_object.add_attribute('time_last', last_seen, type='datetime')
pdns_object.last_seen = last_seen
pdns_object.add_reference(self.attribute.uuid, 'associated-to')
self.misp_event.add_object(**pdns_object)

Expand Down

0 comments on commit 59c9946

Please sign in to comment.