First sync
This commit is contained in:
41
TheHive/API-TheHive.ps1
Normal file
41
TheHive/API-TheHive.ps1
Normal file
@ -0,0 +1,41 @@
|
||||
# Define the API endpoint and headers
|
||||
$apiUrl = "https://thcp19.aws.thehive-cloud.io/9dd3b3a0-f662-4fda-9202-06d13ba6dc90/thehive/api/v1/alert"
|
||||
|
||||
$headers = @{
|
||||
"Authorization" = "Bearer HcWe0tq3s6m+/wRJcJmyR93W17Ave5lb"
|
||||
"accept" = "application/json"
|
||||
"Content-Type" = "application/json"
|
||||
}
|
||||
|
||||
# Define the request body (if needed)
|
||||
$body = @{
|
||||
"type"= "Tentative d'intrusion"
|
||||
"source"= "Firewall"
|
||||
"sourceRef"= "11"
|
||||
"title"= "Tentative d'intrusion"
|
||||
"description"= "Je fais un test un peu plus détaillé"
|
||||
"severity"= 4
|
||||
"tags" = @(
|
||||
"Firewall"
|
||||
)
|
||||
"observables" = @(
|
||||
@{
|
||||
"dataType"= "url"
|
||||
"data"= "https://www.tips-of-mine.com"
|
||||
},
|
||||
@{
|
||||
"dataType"= "mail"
|
||||
"data"= "admin@tips-of-mine.fr"
|
||||
}
|
||||
@{
|
||||
"dataType"= "ip"
|
||||
"data"= "82.66.77.254"
|
||||
}
|
||||
)
|
||||
} | ConvertTo-Json -Depth 10
|
||||
|
||||
# Make the API call using Invoke-RestMethod
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -Method Post -Headers $headers -Body $body
|
||||
|
||||
# Output the response
|
||||
$response
|
Reference in New Issue
Block a user