GithubHelp home page GithubHelp logo

Comments (5)

tomchop avatar tomchop commented on September 13, 2024

Have you tried running the webserver in dev mode? This will give you a full stack trace and it will be much easier to narrow down the error.

from pyeti.

ameygat avatar ameygat commented on September 13, 2024

I ran the server with $python yeti.py webserver
I saw following error in consol when entity post call was made:
Where json data sent to api was

{'aliases': ['testalias1', 'testalias2'],
'context': {},
'description': 'This is test description of a actor',
'name': 'Test1',
'source': 'API',
'tags': ['testtag1', 'testtag2'],
'type': 'Actor'}

python yeti.py webserver
[+] Database version is synced with code.
[+] Yeti started. Point browser to http://localhost:5000/
Filter: {} {}
[2017-09-22 01:15:20,253] ERROR in app: Exception on /api/entity/ [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_classy.py", line 200, in proxy
    response = view(**request.view_args)
  File "/opt/yeti/core/web/helpers.py", line 32, in inner
    return f(*args, **kwargs)
  File "/opt/yeti/core/web/api/crud.py", line 131, in new
    obj = self.objectmanager(**params).save()
  File "/usr/local/lib/python2.7/dist-packages/mongoengine/base/document.py", line 77, in __init__
    raise FieldDoesNotExist(msg)
FieldDoesNotExist: The fields "set([u'source', u'type', u'context', u'aliases'])" do not exist on the document "Entity"

When I saw the error saying fields does not exist in the entity I remove all those fields and ran with new json data as follows

{'name': 'Test1', 'tags': ['testtag1', 'testtag2'], 'description': 'This is test description of a actor'}

This json was accepted and added as entity but issue is I want to add a Entity as actor and if I can not give the type of Entity then Entity does not get added to the Actors.

Could some one Please provide some guidance as how can I add entity as Actor / TTP / Exploit etc.

from pyeti.

ameygat avatar ameygat commented on September 13, 2024

@tomchop Any thing from your side ? Can put some light on this matter ?

from pyeti.

tomchop avatar tomchop commented on September 13, 2024

Right, so it according to this line: FieldDoesNotExist: The fields "set([u'source', u'type', u'context', u'aliases'])" do not exist on the document "Entity" It seems that you're trying to add an Entity with those fields, which does not match the model defined in Yeti.

POSTing to /entity is the right(ishโ€”see below) way to go, but you need a JSON object that matches what Yeti expects. I know that the documentation is very light on what is expected, but the best way to know is to create an entity via the UI and then GET the JSON representation of it.

Also, it seems that you're creating an Entity object when you actually want sub-objects (Actor, Malware, etc.). You'll have to manually set the _cls attribute in your request. Also, you'll have to set fields according to entity.py and actor.py (if what you want to add is an actor).

from pyeti.

Kirtar22 avatar Kirtar22 commented on September 13, 2024

@ameygat - did you manage to get the Entity added to Yeti? for me, even adding entity with minimal parameters also not working.

ERROR:root:An error occurred (500): http://localhost:5000/api/entity/

from pyeti.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.