mirror of https://github.com/MISP/misp-modules
fix: [dns] add the exception in the error message
As there are still distribution installing old version of dnspython, it's easier to debug if we receive the exception directly in misp-module.pull/664/head
parent
0774c75ac3
commit
55d7fc95dc
|
@ -4,7 +4,7 @@ import dns.resolver
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['hostname', 'domain', 'domain|ip'], 'output': ['ip-src',
|
mispattributes = {'input': ['hostname', 'domain', 'domain|ip'], 'output': ['ip-src',
|
||||||
'ip-dst']}
|
'ip-dst']}
|
||||||
moduleinfo = {'version': '0.2', 'author': 'Alexandre Dulaunoy',
|
moduleinfo = {'version': '0.3', 'author': 'Alexandre Dulaunoy',
|
||||||
'description': 'Simple DNS expansion service to resolve IP address from MISP attributes',
|
'description': 'Simple DNS expansion service to resolve IP address from MISP attributes',
|
||||||
'module-type': ['expansion', 'hover']}
|
'module-type': ['expansion', 'hover']}
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ def handler(q=False):
|
||||||
except dns.exception.Timeout:
|
except dns.exception.Timeout:
|
||||||
misperrors['error'] = "Timeout"
|
misperrors['error'] = "Timeout"
|
||||||
return misperrors
|
return misperrors
|
||||||
except Exception:
|
except Exception as e:
|
||||||
misperrors['error'] = "DNS resolving error"
|
misperrors['error'] = f'DNS resolving error {e}'
|
||||||
return misperrors
|
return misperrors
|
||||||
|
|
||||||
r = {'results': [{'types': mispattributes['output'],
|
r = {'results': [{'types': mispattributes['output'],
|
||||||
|
|
Loading…
Reference in New Issue