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

[Bug] API method broken: /api/case/artifact/_search in 4.0.1 #1659

Closed
DrJohn1 opened this issue Nov 17, 2020 · 3 comments
Closed

[Bug] API method broken: /api/case/artifact/_search in 4.0.1 #1659

DrJohn1 opened this issue Nov 17, 2020 · 3 comments
Assignees
Labels
bug TheHive4 TheHive4 related issues
Milestone

Comments

@DrJohn1
Copy link

DrJohn1 commented Nov 17, 2020

API method broken: /api/case/artifact/_search (Bug)

Request Type

Bug

Work Environment

Question Answer
OS version (server) Ubuntu
TheHive version / git hash 4.0.1
Package Type DEB

Problem Description

Any calls to the API method /api/case/artifact/_search return "failed with ''org.thp.thehive.models.Case$$anon$28$$anon$29 cannot be cast to org.thp.thehive.models.Observable'. This happens also from TheHive4py.

Steps to Reproduce

  1. Make a POST call to /api/case/artifact/_search
  2. An error is returned

Complementary information

The error shown:
error_model_observable

@DrJohn1 DrJohn1 added TheHive4 TheHive4 related issues bug labels Nov 17, 2020
@nadouani nadouani added this to the 4.0.2 milestone Nov 17, 2020
@nadouani
Copy link
Contributor

Same thing, I cannot reproduce, calling

curl -XPOST -H "Authorization: Bearer XXXXX" "https://THEHIVE/api/case/artifact/_search"

is working fine

@DrJohn1
Copy link
Author

DrJohn1 commented Nov 17, 2020

The issue appears in 4.0.1 when requesting an attribute using "get_case_observables(...)" thehive4py method.

As with issue #1660, when adding json.dumps() to the method works again:

In 4.0.0:

return requests.post(req, params=params, json=data, proxies=self.proxies, auth=self.auth, verify=self.cert)

An to work in 4.0.1, I added json.dumps() to the data parameter:

return requests.post(req, params=params, json=json.dumps(data), proxies=self.proxies, auth=self.auth, verify=self.cert)

@nadouani
Copy link
Contributor

Thanks @DrJohn1 this sounds like a helpful input.

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

No branches or pull requests

3 participants