Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to create Case Observable #162

Closed
abhijeetasawant opened this issue Jun 4, 2020 · 7 comments
Closed

Not able to create Case Observable #162

abhijeetasawant opened this issue Jun 4, 2020 · 7 comments
Milestone

Comments

@abhijeetasawant
Copy link

Not able to create Case Observable

Request Type

Bug

Work Environment

Question Answer
OS version (server) Ubuntu
OS version (client) Ubuntu
TheHive4py version / git hash 1.7.0.post1

Problem Description

api.create_case_observable(case_id, obs) fails with error code 400 with error message : "Unknown attribute case_artifact.id.

Detailed response :
{"tableName":"case_artifact","type":"AttributeCheckingError","errors":[{"name":"case_artifact.id","type":"UnknownAttributeError","message":"Unknown attribute case_artifact.id: {"type":"JsonInputValue","value":null}","value":{"type":"JsonInputValue","value":null}}]}

Steps to Reproduce

  1. Create TheHiveApi.
  2. Create CaseObservable.
  3. Call api.create_case_observable(case_id, obs)
  4. returns error 400

Possible Solutions

CaseObservable.jsonify() adds "id":null attribute to json. I think this attribute should be removed.

@Felix83000
Copy link

Same error here... Please Help :)
For now it is indeed impossible to create any observable...

@nadouani
Copy link
Contributor

nadouani commented Jun 4, 2020

Hello @abhijeetasawant can you share a code sample that fails? I suppose that obs in api.create_case_observable(case_id, obs) is an instance of thehive4py.models.CaseObservable ?

@nadouani nadouani added this to the 1.7.1 milestone Jun 4, 2020
@abhijeetasawant
Copy link
Author

Yes obs is an instance of thehive4py.models.CaseObservable ?
Sample Code :

    api = TheHiveApi(url, api_key)
    obs = CaseObservable(dataType=data_type,
                         message=description,
                         data=data)

    result = api.create_case_observable(case_id, obs)

@nadouani
Copy link
Contributor

nadouani commented Jun 4, 2020

Got it, the create_case_observable method doesn't exclude the id when calling the API.

Will make a fix for a 1.7.1 patch by tomorrow

@nadouani
Copy link
Contributor

nadouani commented Jun 4, 2020

Guys, could you please update thehive4py and tell me if the problem is solved? I've just released a 1.7.1 version

@abhijeetasawant
Copy link
Author

Yes. Problem is solved. Thank you.

@Felix83000
Copy link

Ok for me. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants