mirror of https://github.com/MISP/misp-modules
Upgrade censys_enrich module to new api version - fix test error
parent
c500dded39
commit
ef543a3fa8
|
@ -60,7 +60,6 @@ def handler(q=False):
|
||||||
attribute = MISPAttribute()
|
attribute = MISPAttribute()
|
||||||
attribute.from_dict(**request['attribute'])
|
attribute.from_dict(**request['attribute'])
|
||||||
# Lists to accomodate multi-types attribute
|
# Lists to accomodate multi-types attribute
|
||||||
conn = list()
|
|
||||||
types = list()
|
types = list()
|
||||||
values = list()
|
values = list()
|
||||||
results = list()
|
results = list()
|
||||||
|
@ -101,7 +100,7 @@ def handler(q=False):
|
||||||
results.append(parse_response(r, attribute))
|
results.append(parse_response(r, attribute))
|
||||||
found = True
|
found = True
|
||||||
except CensysException as e:
|
except CensysException as e:
|
||||||
misperrors['error'] = print("ERROR: param {} / response: {}".format(value, e))
|
misperrors['error'] = "ERROR: param {} / response: {}".format(value, e)
|
||||||
return misperrors
|
return misperrors
|
||||||
|
|
||||||
if not found:
|
if not found:
|
||||||
|
@ -151,7 +150,7 @@ def parse_response(censys_output, attribute):
|
||||||
print("Error !")
|
print("Error !")
|
||||||
if serv.get('ssh') and serv.get('service_name').lower() == 'ssh':
|
if serv.get('ssh') and serv.get('service_name').lower() == 'ssh':
|
||||||
try:
|
try:
|
||||||
cert = serv.get('ssh').get('server_host_key').get('fingerprint_sha256')
|
# cert = serv.get('ssh').get('server_host_key').get('fingerprint_sha256')
|
||||||
# TODO enable once the type is merged
|
# TODO enable once the type is merged
|
||||||
# misp_event.add_attribute(type='hasshserver-sha256', value=cert['fingerprint_sha256'])
|
# misp_event.add_attribute(type='hasshserver-sha256', value=cert['fingerprint_sha256'])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in New Issue