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

Generic Webhook enhancements #27478

Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
752ca8c
Added request header information to the rawJSON output.
mohlcyber Jun 15, 2023
763ad02
Updated Release notes and pack_metadata.json
mohlcyber Jun 15, 2023
91edc9e
Merge branch 'master' into contrib-mohlcyber-GenericWebhook
mohlcyber Jun 15, 2023
cace526
Updated Release notes.
mohlcyber Jun 15, 2023
7bfbb63
Merge remote-tracking branch 'origin/contrib-mohlcyber-GenericWebhook…
mohlcyber Jun 15, 2023
437f019
Updated Release notes.
mohlcyber Jun 15, 2023
f1ee822
Updated Release notes. Updated docker version.
mohlcyber Jun 15, 2023
35b0fcf
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 16, 2023
7c50aff
Adjusted raw_json output.
mohlcyber Jun 19, 2023
01785e1
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 19, 2023
2f02601
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 19, 2023
98909d5
Updated Docker Image
mohlcyber Jun 19, 2023
f720768
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 19, 2023
ab06650
Update Packs/GenericWebhook/ReleaseNotes/1_0_25.md
mohlcyber Jun 19, 2023
f50f86b
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 19, 2023
3766b8f
Remove Authorization header details.
mohlcyber Jun 20, 2023
a5d8b55
Merge remote-tracking branch 'origin/contrib-mohlcyber-GenericWebhook…
mohlcyber Jun 20, 2023
e4687b6
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 20, 2023
bfd1eaf
Updated Known_Words in .pack-ignore
mohlcyber Jun 20, 2023
a7fbdfd
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 20, 2023
c61d2bb
Fixed header_name
mohlcyber Jun 20, 2023
4fd70c2
Merge remote-tracking branch 'origin/contrib-mohlcyber-GenericWebhook…
mohlcyber Jun 20, 2023
38460b0
Merge branch 'contrib/xsoar-contrib_contrib-mohlcyber-GenericWebhook'…
mohlcyber Jun 20, 2023
7a3b0cb
fixed secret_header
mohlcyber Jun 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Packs/GenericWebhook/.pack-ignore
@@ -1,3 +1,5 @@
[file:GenericWebhook.yml]
ignore=BA124

[known_words]
Webhook
@@ -1,3 +1,4 @@
import json
from collections import deque
from copy import copy
from secrets import compare_digest
Expand Down Expand Up @@ -78,6 +79,8 @@ async def handle_post(
return Response(status_code=status.HTTP_401_UNAUTHORIZED, content='Authorization failed.')

raw_json = incident.raw_json or await request.json()
raw_json['headers'] = dict(request.headers)

incident = {
'name': incident.name or 'Generic webhook triggered incident',
'type': incident.type or demisto.params().get('incidentType'),
Expand Down
Expand Up @@ -56,7 +56,7 @@ display: Generic Webhook
name: Generic Webhook
script:
commands: []
dockerimage: demisto/fastapi:1.0.0.43666
dockerimage: demisto/fastapi:1.0.0.63688
feed: false
isfetch: false
longRunning: true
Expand Down
12 changes: 6 additions & 6 deletions Packs/GenericWebhook/Integrations/GenericWebhook/README.md
Expand Up @@ -31,12 +31,12 @@ The examples below assume you invoke the integration via the server HTTPS endpoi
## Usage
The Generic Webhook integration accepts POST HTTP queries, with the following optional fields in the request body:

| **Field** | **Type** | **Description** |
| --- | --- | --- |
| name | string | Name of the incident to be created. |
| type | string | Type of the incident to be created. If not provided, the value of the integration parameter ***Incident type*** will be used. |
| occurred | string | Date the incident occurred in ISO-8601 format. If not provided, the trigger time will be used. |
| raw_json | object | Details of the incident to be created. For example, `{"field1":"value1","field2":"value2"}` |
| **Field** | **Type** | **Description** |
| --- | --- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | string | Name of the incident to be created. |
| type | string | Type of the incident to be created. If not provided, the value of the integration parameter ***Incident type*** will be used. |
| occurred | string | Date the incident occurred in ISO-8601 format. If not provided, the trigger time will be used. |
| raw_json | object | Details of the incident to be created. Headers can be found in a seperate key. For example, `{"field1":"value1","field2":"value2","headers": {"header_field3": "header_value3"}}` |

For example, the following triggers the webhook using cURL:

Expand Down
7 changes: 7 additions & 0 deletions Packs/GenericWebhook/ReleaseNotes/1_0_25.md
@@ -0,0 +1,7 @@
#### Integrations

##### Generic Webhook

- Added the request header information to the output.
- Updated the output to include a separate key for request headers inside raw_json field.
mohlcyber marked this conversation as resolved.
Show resolved Hide resolved
- Updated the Docker image to: *demisto/fastapi:1.0.0.63688*.
2 changes: 1 addition & 1 deletion Packs/GenericWebhook/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Generic Webhook",
"description": "The Generic Webhook integration is used to create incidents on event triggers.",
"support": "xsoar",
"currentVersion": "1.0.24",
"currentVersion": "1.0.25",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down