fireeye/HXTool

Export of rules fails from "Manage rules" page

Closed this issue · 0 comments

When clicking "Export selected" on the "Manage rules" page, an empty error popup is shown and nothing happens. Looking into the logs, the following error occurrs:

[2023-04-14 11:04:11,837] {app} {Thread-245657} ERROR - Exception on /api/v1/indicators/export [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/cert/hxtool/hxtool-4.7.1/hxtool_util.py", line 52, in is_session_valid
ret = f(*args, **kwargs)
File "/home/cert/hxtool/hxtool-4.7.1/hxtool_api.py", line 1349, in hxtool_api_indicators_export
return send_file(buffer, attachment_filename=iocfname, as_attachment=True)
TypeError: send_file() got an unexpected keyword argument 'attachment_filename'

Apparently this is caused by Flask not supporting the "attachment_filename" anymore:

https://stackoverflow.com/questions/73276384/getting-an-error-attachment-filename-does-not-exist-in-my-docker-environment

Solution (I think): Replace all occurrences of "attachement_filename" with "download_name". There might be other variable names that need to be replaced as well.