add hostname

pull/498/head
Sebdraven 2021-04-23 16:19:47 +02:00
parent e1c2c779aa
commit 098616846d
1 changed files with 9 additions and 0 deletions

View File

@ -52,6 +52,15 @@ class OnypheClient:
elif type(domain) == str: elif type(domain) == str:
self.__get_object_domain_ip(domain, 'domain') self.__get_object_domain_ip(domain, 'domain')
if 'hostname' in r:
hostname = r['hostname']
if type(hostname) == list:
for d in hostname:
self.__get_object_domain_ip(d, 'domain')
elif type(hostname) == str:
self.__get_object_domain_ip(hostname, 'domain')
def __get_object_domain_ip(self, obs, relation): def __get_object_domain_ip(self, obs, relation):
objet_domain_ip = MISPObject('domain-ip') objet_domain_ip = MISPObject('domain-ip')
objet_domain_ip.add_attribute(relation, obs) objet_domain_ip.add_attribute(relation, obs)