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

API: cannot create alert if one alert artifact contains the IOC field set #268

Closed
rolinh opened this issue Jul 24, 2017 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@rolinh
Copy link

rolinh commented Jul 24, 2017

Request Type

Bug

Work Environment

Question Answer
OS version (server) Ubuntu
OS version (client) 16.04
TheHive version / git hash 2.12.0
Package Type Binary

Problem Description

Trying to create an alert using an HTTP post request on /api/alert with an alert which contains the IOC field set in one of its observables/artifacts results in a 400 Bad Request being returned by the server with a message like this one:

{"tableName":"alert","type":"AttributeCheckingError","errors":[[{"name":"alert.artifacts","format":"string","value":{"type":"JsonInputValue","value":true},"type":"InvalidFormatAttributeError","message":"Invalid format for alert.artifacts: JsonInputValue(true), expected string"}]]}

By the way, the message returned by the API server is rather cryptic. I had to trial and error several times to find which attribute of my alert was causing the issue and lost considerable time... Improvements in this area welcome 😃 .

Steps to Reproduce

curl -XPOST -u myuser:mypassword -H 'Content-Type: application/json' http://127.0.0.1:9000/api/alert -d '{
  "title": "Other alert",
  "description": "alert description",
  "type": "external",
  "source": "instance1",
  "sourceRef": "alert-ref",
  "severity": 3,
  "tlp": 3,
  "artifacts": [
    { "dataType": "ip", "data": "127.0.0.1", "message": "localhost", "ioc": true }
  ],
  "caseTemplate": "external-alert"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants