yeti-platform / yeti

Your Everyday Threat Intelligence
https://yeti-platform.io/
Apache License 2.0
1.74k stars 287 forks source link

Unable to add multiple observables to an entity #588

Closed theotheryuri closed 4 years ago

theotheryuri commented 4 years ago

Description

This issue follows on from #586 .

Adding more than one observable to an entity fails. The observables appear to be successfully added with the relevant tags and links to the associated entity, however they do not appear in the "observables" tab of the entity. Binding between entities works fine.

Conditions under which the issue occurs is as follows:

See below for steps to reproduce.

**Notable observations:

NOTE:

Environment

OS Version: Ubuntu 20.04 LTS Git commit: 0f919f8 Mongo version: 3.6.8

Note this is a new/fresh install.

Steps to Reproduce

Scenario 1:

  1. From the UI browse to the Search and Add page.
  2. Add a new domain observable and tag it to an existing actor
  3. Observable appears to be created correctly according to the results page. Tag is correct and Actor is listed in the Related Entities field.
  4. Clicking on the value hyperlink, to go to the observable. Domain is recognized correctly, tags are correct and Related Entites are correct.
  5. Click on the Related Entities hyperlink, to go to the actor.
  6. Click the Observables tab and the entity is there as it should be. Nothing notable the system logs.
  7. Return to the Search and Add screen.
  8. Add a new observable, tagging it to the same actor
  9. Observable appears to be created correctly according to the results page. Tag is correct and Actor is listed in the Related Entities field.
  10. Clicking on the value hyperlink, to go to the observable. Domain is recognized correctly, tags are correct and Related Entites are correct.
  11. Click the Observables tab. The previously added observable is now gone and the new observable is also not present.

Scenario 2:

  1. From the UI browse to the Search and Add page.
  2. Add two (or more) observables (type doesn't appear to matter) into the box and tag it to an existing actor and launch it.
  3. Observables appear to be created correctly according to the results page. Tag is correct and Actor is listed in the Related Entities field
  4. Click on the Related Entities hyperlink, to go to the actor.
  5. Click the Observables tab. None of the observables are present.

Diagnostics

Logs from Scenario 1
yeti-test uwsgi[951]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[951]: INFO:observables:User yeti add observable : value={'matches': [], 'unknown': set(), 'entities': [{'name': 'TEST-ACTOR', 'description': '', 'tags': ['actor-tag-test-actor'], 'id': '5ebb9f6a87f5769758aabf1e', 'url': 'http://localhost:5000/api/entity/5ebb9f6a87f5769758aabf1e', 'human_url': 'http://localhost:5000/entity/5ebb9f6a87f5769758aabf1e', 'aliases': ['APT1'], 'type': 'Actor', 'matches': {'observables': [{'name': 'TEST-ACTOR', 'description': '', 'tags': ['actor-tag-test-actor'], 'id': '5ebb9f6a87f5769758aabf1e', 'url': 'http://localhost:5000/api/entity/5ebb9f6a87f5769758aabf1e', 'human_url': 'http://localhost:5000/entity/5ebb9f6a87f5769758aabf1e', 'aliases': ['APT1'], 'type': 'Actor', 'matched_observable': {'value': '192.168.2.1', 'tags': ['actor-tag-test-actor'], 'human_url': 'http://localhost:5000/observable/5ec88a676dc50e2798a05c85', 'url': 'http://localhost:5000/api/observable/5ec88a676dc50e2798a05c85', 'context': []}}]}}], 'known': [{'value': '192.168.2.1', 'sources': [], 'description': None, 'context': [], 'last_analyses': {}, 'created': datetime.datetime(2020, 5, 23, 2, 28, 55, 569000), 'tags': [{'name': 'actor-tag-test-actor', 'first_seen': datetime.datetime(2020, 5, 23, 2, 28, 55, 636000), 'last_seen': datetime.datetime(2020, 5, 23, 2, 28, 55, 636000), 'fresh': True}], 'id': '5ec88a676dc50e2798a05c85', 'type': 'Ip', 'url': 'http://localhost:5000/api/observable/5ec88a676dc50e2798a05c85', 'human_url': 'http://localhost:5000/observable/5ec88a676dc50e2798a05c85'}], 'neighbors': []}
yeti-test uwsgi[951]: [pid: 951|app: 0|req: 3/30] 127.0.0.1 () {50 vars in 1082 bytes} [Sat 2020] POST /observable/ => generated 11224 bytes in 358 msecs (HTTP/1.1 200) 2 headers in 82 bytes (1 switches on core 0)
yeti-test uwsgi[951]: [pid: 951|app: 0|req: 4/31] 127.0.0.1 () {46 vars in 906 bytes} [Sat 2020] GET /static/font-awesome/css/font-awesome.min.css => generated 0 bytes in 2 msecs (HTTP/1.1 304) 4 headers in 185 bytes (0 switches on core 1)
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 13/32] 127.0.0.1 () {46 vars in 886 bytes} [Sat 2020] GET /static/animate.css/animate.min.css => generated 0 bytes in 1 msecs (HTTP/1.1 304) 4 headers in 185 bytes (0 switches on core 1)
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 14/33] 127.0.0.1 () {46 vars in 896 bytes} [Sat 2020] GET /static/simplemde/dist/simplemde.min.css => generated 0 bytes in 6 msecs (HTTP/1.1 304) 4 headers in 185 bytes (0 switches on core 0)
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 14/34] 127.0.0.1 () {46 vars in 895 bytes} [Sat 2020] GET /static/highlight.js/styles/obsidian.css => generated 0 bytes in 4 msecs (HTTP/1.1 304) 4 headers in 184 bytes (0 switches on core 1)
yeti-test uwsgi[950]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[950]: [pid: 950|app: 0|req: 4/35] 127.0.0.1 () {42 vars in 749 bytes} [Sat 2020] GET /staticfiles/yeti/js/query.js => generated 1614 bytes in 20 msecs via sendfile() (HTTP/1.1 200) 7 headers in 298 bytes (0 switches on core 1)
yeti-test uwsgi[950]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[950]: [pid: 950|app: 0|req: 5/36] 127.0.0.1 () {44 vars in 861 bytes} [Sat 2020] GET /entity/5ebb9f6a87f5769758aabf1e => generated 32405 bytes in 371 msecs (HTTP/1.1 200) 2 headers in 82 bytes (1 switches on core 0)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 14/37] 127.0.0.1 () {44 vars in 824 bytes} [Sat 2020] GET /staticfiles/yeti/js/crud.js => generated 0 bytes in 7 msecs (HTTP/1.1 304) 4 headers in 187 bytes (0 switches on core 1)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 15/38] 127.0.0.1 () {44 vars in 834 bytes} [Sat 2020] GET /staticfiles/yeti/js/selection.js => generated 0 bytes in 7 msecs (HTTP/1.1 304) 4 headers in 187 bytes (0 switches on core 0)
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 15/39] 127.0.0.1 () {46 vars in 1016 bytes} [Sat 2020] GET /static/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 => generated 0 bytes in 2 msecs (HTTP/1.1 304) 4 headers in 184 bytes (0 switches on core 0)
yeti-test uwsgi[952]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 16/40] 127.0.0.1 () {44 vars in 920 bytes} [Sat 2020] GET /staticfiles/yeti/font/yetiicons.woff2?6178616 => generated 0 bytes in 15 msecs (HTTP/1.1 304) 4 headers in 187 bytes (0 switches on core 1)
yeti-test uwsgi[951]: [pid: 951|app: 0|req: 5/41] 127.0.0.1 () {46 vars in 1011 bytes} [Sat 2020] GET /static/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 => generated 0 bytes in 2 msecs (HTTP/1.1 304) 4 headers in 185 bytes (0 switches on core 1)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [Neighbors] Filter: {}
yeti-test uwsgi[953]: <class 'core.entities.ttp.TTP'> {} True True 0 50
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [Neighbors] Filter: {}
yeti-test uwsgi[953]: <class 'core.entities.malware.Malware'> {} True True 0 50
yeti-test uwsgi[951]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[951]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[952]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[951]: [Neighbors] Filter: {}
yeti-test uwsgi[951]: [Neighbors] Filter: {}
yeti-test uwsgi[951]: <class 'core.entities.campaign.Campaign'> {} True True 0 50
yeti-test uwsgi[951]: <class 'core.entities.actor.Actor'> {} True True 0 50
yeti-test uwsgi[952]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[952]: [Neighbors] Filter: {}
yeti-test uwsgi[952]: <class 'core.entities.exploit.Exploit'> {} True True 0 50
yeti-test uwsgi[952]: [Neighbors] Filter: {}
yeti-test uwsgi[952]: <class 'core.entities.exploit_kit.ExploitKit'> {} True True 0 50
yeti-test uwsgi[951]: [pid: 951|app: 0|req: 7/42] 127.0.0.1 () {50 vars in 991 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/campaign => generated 69 bytes in 364 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
yeti-test uwsgi[950]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[951]: [pid: 951|app: 0|req: 7/43] 127.0.0.1 () {50 vars in 985 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/actor => generated 69 bytes in 405 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 0)
yeti-test uwsgi[950]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[950]: [Neighbors] Filter: {}
yeti-test uwsgi[950]: <class 'core.observables.observable.Observable'> {} True True 0 50
yeti-test uwsgi[950]: [Neighbors] Filter: {}
yeti-test uwsgi[950]: <class 'core.indicators.indicator.Indicator'> {} True True 0 50
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 18/44] 127.0.0.1 () {50 vars in 995 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/exploitkit => generated 69 bytes in 428 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 18/45] 127.0.0.1 () {50 vars in 989 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/exploit => generated 69 bytes in 464 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 0)
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 17/46] 127.0.0.1 () {50 vars in 989 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/malware => generated 3805 bytes in 590 msecs (HTTP/1.1 200) 2 headers in 81 bytes (1 switches on core 0)
yeti-test uwsgi[950]: [pid: 950|app: 0|req: 7/47] 127.0.0.1 () {50 vars in 993 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/indicator => generated 63 bytes in 217 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
yeti-test uwsgi[950]: [pid: 950|app: 0|req: 7/48] 127.0.0.1 () {50 vars in 995 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/observable => generated 1123 bytes in 223 msecs (HTTP/1.1 200) 2 headers in 81 bytes (1 switches on core 0)
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 17/49] 127.0.0.1 () {50 vars in 981 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/ttp => generated 69 bytes in 677 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
yeti-test uwsgi[952]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[952]: [pid: 952|app: 0|req: 19/50] 127.0.0.1 () {44 vars in 841 bytes} [Sat 2020] GET /observable/ => generated 14034 bytes in 9 msecs (HTTP/1.1 200) 2 headers in 82 bytes (1 switches on core 1)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 18/51] 127.0.0.1 () {44 vars in 791 bytes} [Sat 2020] GET /api/tag/ => generated 20587 bytes in 74 msecs (HTTP/1.1 200) 2 headers in 74 bytes (1 switches on core 0)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: INFO:observables:User yeti add observable : value={'matches': [], 'unknown': set(), 'entities': [{'name': 'TEST-ACTOR', 'description': '', 'tags': ['actor-tag-test-actor'], 'id': '5ebb9f6a87f5769758aabf1e', 'url': 'http://localhost:5000/api/entity/5ebb9f6a87f5769758aabf1e', 'human_url': 'http://localhost:5000/entity/5ebb9f6a87f5769758aabf1e', 'aliases': ['APT1'], 'type': 'Actor', 'matches': {'observables': [{'name': 'TEST-ACTOR', 'description': '', 'tags': ['actor-tag-test-actor'], 'id': '5ebb9f6a87f5769758aabf1e', 'url': 'http://localhost:5000/api/entity/5ebb9f6a87f5769758aabf1e', 'human_url': 'http://localhost:5000/entity/5ebb9f6a87f5769758aabf1e', 'aliases': ['APT1'], 'type': 'Actor', 'matched_observable': {'value': 'test.domain.com', 'tags': ['actor-tag-test-actor'], 'human_url': 'http://localhost:5000/observable/5ec88a806dc50e2798a05d2e', 'url': 'http://localhost:5000/api/observable/5ec88a806dc50e2798a05d2e', 'context': []}}]}}], 'known': [{'value': 'domain.com', 'sources': ['analytics'], 'description': None, 'context': [], 'last_analyses': {}, 'created': datetime.datetime(2020, 5, 23, 2, 29, 20, 963000), 'tags': [], 'id': '5ec88a806dc50e2798a05d38', 'type': 'Hostname', 'url': 'http://localhost:5000/api/observable/5ec88a806dc50e2798a05d38', 'human_url': 'http://localhost:5000/observable/5ec88a806dc50e2798a05d38'}, {'value': 'test.domain.com', 'sources': [], 'description': None, 'context': [], 'last_analyses': {}, 'created': datetime.datetime(2020, 5, 23, 2, 29, 20, 930000), 'tags': [{'name': 'actor-tag-test-actor', 'first_seen': datetime.datetime(2020, 5, 23, 2, 29, 21, 10000), 'last_seen': datetime.datetime(2020, 5, 23, 2, 29, 21, 10000), 'fresh': True}], 'id': '5ec88a806dc50e2798a05d2e', 'type': 'Hostname', 'url': 'http://localhost:5000/api/observable/5ec88a806dc50e2798a05d2e', 'human_url': 'http://localhost:5000/observable/5ec88a806dc50e2798a05d2e'}], 'neighbors': []}
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 19/52] 127.0.0.1 () {50 vars in 1080 bytes} [Sat 2020] POST /observable/ => generated 11372 bytes in 317 msecs (HTTP/1.1 200) 2 headers in 82 bytes (1 switches on core 1)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 20/53] 127.0.0.1 () {44 vars in 861 bytes} [Sat 2020] GET /entity/5ebb9f6a87f5769758aabf1e => generated 32405 bytes in 177 msecs (HTTP/1.1 200) 2 headers in 82 bytes (1 switches on core 0)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [Neighbors] Filter: {}
yeti-test uwsgi[953]: <class 'core.entities.ttp.TTP'> {} True True 0 50
yeti-test uwsgi[950]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 21/54] 127.0.0.1 () {50 vars in 981 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/ttp => generated 69 bytes in 13 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
yeti-test uwsgi[950]: [Neighbors] Filter: {}
yeti-test uwsgi[950]: <class 'core.entities.malware.Malware'> {} True True 0 50
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [Neighbors] Filter: {}
yeti-test uwsgi[953]: <class 'core.entities.actor.Actor'> {} True True 0 50
yeti-test uwsgi[953]: [Neighbors] Filter: {}
yeti-test uwsgi[953]: <class 'core.entities.campaign.Campaign'> {} True True 0 50
yeti-test uwsgi[952]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 23/55] 127.0.0.1 () {50 vars in 985 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/actor => generated 69 bytes in 36 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 0)
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 23/56] 127.0.0.1 () {50 vars in 991 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/campaign => generated 69 bytes in 27 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
yeti-test uwsgi[953]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: [Neighbors] Filter: {}
yeti-test uwsgi[953]: <class 'core.observables.observable.Observable'> {} True True 0 50
yeti-test uwsgi[951]: INFO:user_management:Default user logged in : yeti
yeti-test uwsgi[953]: ERROR:app:Exception on /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/observable [POST]
yeti-test uwsgi[953]: Traceback (most recent call last):
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2446, in wsgi_app
yeti-test uwsgi[953]:     response = self.full_dispatch_request()
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1951, in full_dispatch_request
yeti-test uwsgi[953]:     rv = self.handle_user_exception(e)
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1820, in handle_user_exception
yeti-test uwsgi[953]:     reraise(exc_type, exc_value, tb)
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
yeti-test uwsgi[953]:     raise value
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1949, in full_dispatch_request
yeti-test uwsgi[953]:     rv = self.dispatch_request()
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1935, in dispatch_request
yeti-test uwsgi[953]:     return self.view_functions[rule.endpoint](**req.view_args)
yeti-test uwsgi[953]:   File "/usr/local/lib/python3.8/dist-packages/flask_classy.py", line 200, in proxy
yeti-test uwsgi[953]:     response = view(**request.view_args)
yeti-test uwsgi[953]:   File "./core/web/helpers.py", line 39, in inner
yeti-test uwsgi[953]:     return f(*args, **kwargs)
yeti-test uwsgi[953]:   File "./core/web/api/neighbors.py", line 70, in tuples
yeti-test uwsgi[953]:     neighbors = node.neighbors_advanced(
yeti-test uwsgi[953]:   File "./core/database.py", line 471, in neighbors_advanced
yeti-test uwsgi[953]:     klass = klass.subclass_from_name(n['_cls'].split('.')[1])
yeti-test uwsgi[953]:   File "./core/database.py", line 528, in subclass_from_name
yeti-test uwsgi[953]:     raise GenericYetiError(
yeti-test uwsgi[953]: core.errors.GenericYetiError: Hostname is not a subclass of Ip
yeti-test uwsgi[951]: [Neighbors] Filter: {}
yeti-test uwsgi[952]: [Neighbors] Filter: {}
yeti-test uwsgi[951]: <class 'core.indicators.indicator.Indicator'> {} True True 0 50
yeti-test uwsgi[952]: <class 'core.entities.exploit.Exploit'> {} True True 0 50
yeti-test uwsgi[953]: [pid: 953|app: 0|req: 24/57] 127.0.0.1 () {50 vars in 995 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/observable => generated 290 bytes in 55 msecs (HTTP/1.1 500) 2 headers in 99 bytes (1 switches on core 0)
Logs from Scenario 2
yeti-test uwsgi[968]: [Neighbors] Filter: {}
yeti-test uwsgi[968]: <class 'core.entities.campaign.Campaign'> {} True True 0 50
yeti-test uwsgi[968]: [Neighbors] Filter: {}
yeti-test uwsgi[968]: <class 'core.entities.exploit.Exploit'> {} True True 0 50
yeti-test uwsgi[971]: [Neighbors] Filter: {}
yeti-test uwsgi[971]: <class 'core.entities.malware.Malware'> {} True True 0 50
yeti-test uwsgi[972]: [Neighbors] Filter: {}
yeti-test uwsgi[972]: <class 'core.entities.actor.Actor'> {} True True 0 50
yeti-test uwsgi[970]: [Neighbors] Filter: {}
yeti-test uwsgi[970]: <class 'core.entities.exploit_kit.ExploitKit'> {} True True 0 50
May 23 12:19:41 yeti-test uwsgi[972]: [pid: 972|app: 0|req: 14/42] 127.0.0.1 () {50 vars in 985 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/actor => generated 69 bytes in 199 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1) 
May 23 12:19:41 yeti-test uwsgi[970]: INFO:user_management:Default user logged in : yeti
May 23 12:19:41 yeti-test uwsgi[970]: [Neighbors] Filter: {}
May 23 12:19:41 yeti-test uwsgi[970]: <class 'core.indicators.indicator.Indicator'> {} True True 0 50
May 23 12:19:41 yeti-test uwsgi[971]: [pid: 971|app: 0|req: 17/43] 127.0.0.1 () {50 vars in 989 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/malware => generated 3805 bytes in 348 msecs (HTTP/1.1 200) 2 headers in 81 bytes (1 switches on core 0)
May 23 12:19:41 yeti-test uwsgi[972]: INFO:user_management:Default user logged in : yeti
May 23 12:19:41 yeti-test uwsgi[971]: [pid: 971|app: 0|req: 17/44] 127.0.0.1 () {50 vars in 981 bytes} [Sat 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/ttp => generated 69 bytes in 386 msecs (HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 1)
May 23 12:19:41 yeti-test uwsgi[972]: [Neighbors] Filter: {}
May 23 12:19:41 yeti-test uwsgi[972]: <class 'core.observables.observable.Observable'> {} True True 0 50
May 23 12:19:41 yeti-test uwsgi[972]: ERROR:app:Exception on /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/observable [POST]
May 23 12:19:41 yeti-test uwsgi[972]: Traceback (most recent call last):
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2446, in wsgi_app
May 23 12:19:41 yeti-test uwsgi[972]:     response = self.full_dispatch_request()
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1951, in full_dispatch_request
May 23 12:19:41 yeti-test uwsgi[972]:     rv = self.handle_user_exception(e)
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1820, in handle_user_exception
May 23 12:19:41 yeti-test uwsgi[972]:     reraise(exc_type, exc_value, tb)
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
May 23 12:19:41 yeti-test uwsgi[972]:     raise value
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1949, in full_dispatch_request
May 23 12:19:41 yeti-test uwsgi[972]:     rv = self.dispatch_request()
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1935, in dispatch_request
May 23 12:19:41 yeti-test uwsgi[972]:     return self.view_functions[rule.endpoint](**req.view_args) 
May 23 12:19:41 yeti-test uwsgi[972]:   File "/usr/local/lib/python3.8/dist-packages/flask_classy.py", line 200, in proxy
May 23 12:19:41 yeti-test uwsgi[972]:     response = view(**request.view_args)
May 23 12:19:41 yeti-test uwsgi[972]:   File "./core/web/helpers.py", line 39, in inner
May 23 12:19:41 yeti-test uwsgi[972]:     return f(*args, **kwargs)
May 23 12:19:41 yeti-test uwsgi[972]:   File "./core/web/api/neighbors.py", line 70, in tuples
May 23 12:19:41 yeti-test uwsgi[972]:     neighbors = node.neighbors_advanced(
May 23 12:19:41 yeti-test uwsgi[972]:   File "./core/database.py", line 471, in neighbors_advanced
May 23 12:19:41 yeti-test uwsgi[972]:     klass = klass.subclass_from_name(n['_cls'].split('.')[1])
May 23 12:19:41 yeti-test uwsgi[972]:   File "./core/database.py", line 528, in subclass_from_name
May 23 12:19:41 yeti-test uwsgi[972]:     raise GenericYetiError(
May 23 12:19:41 yeti-test uwsgi[972]: core.errors.GenericYetiError: Hostname is not a subclass of Ip
May 23 12:19:41 yeti-test uwsgi[972]: [pid: 972|app: 0|req: 15/45] 127.0.0.1 () {50 vars in 995 bytes} [Sat May 23 12:19:41 2020] POST /api/neighbors/tuples/entity/5ebb9f6a87f5769758aabf1e/observable => generated 290 bytes in 65 msecs (HTTP/1.1 500) 2 headers in 99 bytes (1 switches on core 0)
tomchop commented 4 years ago

This should be fixed in 0a052ecf007fe14944f8907ea33080855ae30457. Thanks for the very detailed report! It was super useful :)

theotheryuri commented 4 years ago

Working wonderfully! Thanks for your effort @tomchop. :)