Skip to content

Commit

Permalink
Add DNSDB API parameters (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-cossi authored and nadouani committed Dec 10, 2018
1 parent 23345ae commit a7708cb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions analyzers/DNSDB/dnsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ def __init__(self):

def execute_dnsdb_service(self, client):
data = self.get_data()
rrtype = self.getParam('parameters.rrtype', None, None)
bailiwick = self.getParam('parameters.bailiwick', None, None)
before = self.getParam('parameters.before', None, None)
after = self.getParam('parameters.after', None, None)

if self.service == 'domain_name' and self.data_type in ['domain', 'fqdn']:
return client.query_rrset(data)
return client.query_rrset(data, rrtype=rrtype, bailiwick=bailiwick, before=before, after=after)
elif self.service == 'ip_history' and self.data_type == 'ip':
return client.query_rdata_ip(data)
return client.query_rdata_ip(data, before=before, after=after)
elif self.service == 'name_history' and self.data_type in ['domain', 'fqdn']:
return client.query_rdata_name(data)
return client.query_rdata_name(data, rrtype=rrtype, before=before, after=after)
else:
self.error('Unknown DNSDB service or invalid data type')

Expand Down

0 comments on commit a7708cb

Please sign in to comment.