eclecticiq / OpenTAXII

TAXII server implementation in Python from EclecticIQ
BSD 3-Clause "New" or "Revised" License
193 stars 92 forks source link

Some questions about push #164

Closed LiuH2 closed 4 years ago

LiuH2 commented 4 years ago

I used poll command get some data from https://www.taxiistand.com/ or http://hailataxii.com/,but I can't used push command push it to my inbox-a server. I used push command : taxii-push --path http://localhost:9000/services/inbox-a -f /home/lh/text_xml.xml --username admin --password admin

and Terminal window display: 2020-04-07 19:40:58,136 INFO: Sending Inbox_Message to http://localhost:9000/services/inbox-a 2020-04-07 19:40:58,306 ERROR: HTTP Error: status code 500

My configuration file is data-configuration.yml.

arcsector commented 4 years ago

Hi,

  1. Please format your issue with code formatting for code and response.
  2. Have you tried specifying a destination collection? It would be using the --dest flag
traut commented 4 years ago

@LiuH2 could you please provide full error stack trace from your OpenTAXII instance?

ruffy91 commented 4 years ago

I think I got a similar problem There is also a issue about this by another user here: https://github.com/MISP/MISP/issues/5795 Stack Trace:

Apr 20 09:13:52 RB00SRV032 gunicorn[30222]: {"event": "Checking for existence of 101.55.125.10", "logger": "main", "level": "info", "timestamp": "2020-04-20T09:13:52.470809Z"}
Apr 20 09:13:52 RB00SRV032 gunicorn[30222]: {"event": "Exception on /services/inbox [POST]", "exc_info": ["<class 'KeyError'>", "KeyError('response',)", "<traceback object at 0x7f7fb73fa208>"], "logger": "opentaxii.middleware", "level": "error", "timestamp": "2020-04-20T09:13:52.975626Z"}
Apr 20 09:13:52 RB00SRV032 gunicorn[30222]: {"event": "Internal error", "logger": "opentaxii.middleware", "level": "error", "timestamp": "2020-04-20T09:13:52.976318Z", "exception": "Traceback (most recent call last):
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
 response = self.full_dispatch_request()
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
 rv = self.handle_user_exception(e)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
 reraise(exc_type, exc_value, tb)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
 raise value
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
 rv = self.dispatch_request()
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
 return self.view_functionsrule.endpoint
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/opentaxii/middleware.py", line 85, in wrapper
 return _process_with_service(service)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/opentaxii/middleware.py", line 163, in _process_with_service
 response_message = service.process(request.headers, taxii_message)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/opentaxii/taxii/services/abstract.py", line 83, in process
 response_message = handler.handle_message(self, message)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/opentaxii/taxii/services/handlers/inbox_message_handlers.py", line 123, in handle_message
 return InboxMessage11Handler.handle_message(service, request)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/opentaxii/taxii/services/handlers/inbox_message_handlers.py", line 63, in handle_message
 inbox_message_id=inbox_message.id if inbox_message else None)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/opentaxii/persistence/manager.py", line 197, in create_content
 collection_ids=collection_ids, service_id=service_id)
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/blinker/base.py", line 267, in send
 for receiver in self.receivers_for(sender)]
 File "/opt/MISP-Taxii-Server/venv/lib/python3.6/site-packages/blinker/base.py", line 267, in 
 for receiver in self.receivers_for(sender)]
 File "/opt/MISP-Taxii-Server/misp_taxii_hooks/hooks.py", line 69, in post_stix
 if search["response"]["Attribute"] != []:
KeyError: 'response'"}
traut commented 4 years ago

@ruffy91

...
 File "/opt/MISP-Taxii-Server/misp_taxii_hooks/hooks.py", line 69, in post_stix
 if search["response"]["Attribute"] != []:
KeyError: 'response'"}

this looks like an error in MISP-Taxii-Server code, not in OpenTAXII code

arcsector commented 4 years ago

@traut @ruffy91 this is fixed in PR 82 for MISP-Taxii-Server