Thehive: [Bug] WebHook creation does not work

Created on 12 May 2020  Â·  6Comments  Â·  Source: TheHive-Project/TheHive

Bug / Feature Request

Work Environment

| Question | Answer
|---------------------------|--------------------
| OS version (server) | Debian
| OS version (client) | 10
| TheHive version / git hash | 4 RC2
| Package Type | DEB

Problem Description

I tried to create a webhook.
Basically there is a little mistake in the documentation about the curl command, see my PR here:
https://github.com/TheHive-Project/TheHiveDocs/pull/167

But never the less, after creation it just returns:
{"path":"notification","defaultValue":[],"value":null}

Which sounds wrong to my eyes.
After trying to perform a get command to /api/config/organisation/notification it is also returning this result.
The WebHook does not work.
Can you take a look into that and give me a little hint?

TheHive4 bug

Most helpful comment

Now version 0 doesn't include parent object and version 1 does. This let you choose.

All 6 comments

The documentation was wrong. The correct body is:

{
  "value": [
    {
      "delegate": false,
      "trigger": { "name": "AnyEvent"},
      "notifier": { "name": "webhook", "endpoint": "local" }
    }
  ]
}

@crackytsi I let you tell me if webhooks work for you before I close this issue.

Not @crackytsi here but can confirm the updated POST body works now.

Also, looks like the setting is set per organisiation and not globally.

On Sat, May 16, 2020 at 7:29 PM To-om notifications@github.com wrote:

The documentation was wrong. The correct body is:

{
"value": [
{
"delegate": false,
"trigger": { "name": "AnyEvent"},
"notifier": { "name": "webhook", "endpoint": "local" }
}
]
}

@crackytsi https://github.com/crackytsi I let you tell me if webhooks
work for you before I close this issue.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/TheHive-Project/TheHive/issues/1318#issuecomment-629616697,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGWR3JBGLNEZGUWGZWV6AUTRRZMIVANCNFSM4M6RWBHQ
.

@To-om : Thank you very much, it works.
Can you please also share a curl that removes this configuration?

I also noted that compared to the old-webhook all nested objects are added (e.g. update of log --> contains data of case-task and case). Meanwhile in some situtations that might be helpfull in others this generates bigger responses and slows down the speed. Is this configurable to have the output same as in the 2.x and 3.x releases?

Now version 0 doesn't include parent object and version 1 does. This let you choose.

@crackytsi if you want to remove webhook, set an empty list:

curl -XPUT \
  -u$thehive_user:$thehive_password \
  -H 'Content-type: application/json' \
  $thehive_url/api/config/organisation/notification -d '
    {
      "value": []
    }
  '

Thank you very much :)

Was this page helpful?
0 / 5 - 0 ratings