mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 23:32:47 +01:00
refactor: remove pocketbase (#1138)
This commit is contained in:
20
app/data/scripts/alertingest.py
Normal file
20
app/data/scripts/alertingest.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import sys
|
||||
import json
|
||||
import random
|
||||
import os
|
||||
|
||||
import requests
|
||||
|
||||
# Parse the event from the webhook payload
|
||||
event = json.loads(sys.argv[1])
|
||||
body = json.loads(event["body"])
|
||||
|
||||
url = os.environ["CATALYST_APP_URL"]
|
||||
header = {"Authorization": "Bearer " + os.environ["CATALYST_TOKEN"]}
|
||||
|
||||
# Create a new ticket
|
||||
requests.post(url + "/api/tickets", headers=header, json={
|
||||
"name": body["name"],
|
||||
"type": "alert",
|
||||
"open": True,
|
||||
})
|
||||
Reference in New Issue
Block a user