Send first script

This commit is contained in:
2025-06-03 09:53:55 +02:00
parent dd0502453d
commit 858b6c168c
6 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
# Définir les variables de configuration # Définir les variables de configuration
$jsonKeyFile = "C:\Users\hcornet\Downloads\ari-prj-np-mdf-001-d6cd222549da.json" # Modifier le chemin vers votre fichier JSON d'authentification $jsonKeyFile = "d6cd222549da.json" # Modifier le chemin vers votre fichier JSON d'authentification
$projectId = "ari-prj-np-mdf-001" # Remplacez par l'ID de votre projet GCP $projectId = "abc-prj-np-mdf-001" # Remplacez par l'ID de votre projet GCP
$subscriptionName = "alerte:pull" # Remplacez par le nom de la subscription Pub/Sub $subscriptionName = "alerte:pull" # Remplacez par le nom de la subscription Pub/Sub
$APIUrl = "https://pubsub.googleapis.com/v1" $APIUrl = "https://pubsub.googleapis.com/v1"

View File

@ -1,8 +1,8 @@
# Définir les variables de configuration # Définir les variables de configuration
#$jsonKeyFile = "C:\Users\hcornet\Downloads\ari-prj-np-mdf-001-d6cd222549da.json" # Modifier le chemin vers votre fichier JSON d'authentification #$jsonKeyFile = "d6cd222549da.json" # Modifier le chemin vers votre fichier JSON d'authentification
$jsonKeyFile = "C:\Users\hcornet\Downloads\ari-prj-mdf-001-e24a11fe72e5.json" $jsonKeyFile = "24a11fe72e5.json"
#$projectId = "ari-prj-np-mdf-001" #$projectId = "abc-prj-np-mdf-001"
$projectId = "ari-prj-mdf-001" $projectId = "abc-prj-mdf-001"
$Topic = "MindFlow:publish" $Topic = "MindFlow:publish"
$subscription = "Alerte:pull" $subscription = "Alerte:pull"
$APIUrl = "https://pubsub.googleapis.com/v1" $APIUrl = "https://pubsub.googleapis.com/v1"

View File

@ -1,7 +1,7 @@
$ProjectId = "ari-prj-np-mdf-001" $ProjectId = "abc-prj-np-mdf-001"
$TopicName = "MindFlow:publish" $TopicName = "MindFlow:publish"
$Message = "Vendredi 23 mai à 12:00" $Message = "Vendredi 23 mai à 12:00"
$AccessToken = "ya29.a0AW4Xtxhb0o5hP7lkY1kH6ZplZy2hUlfLP1l7QDQlv8th758tD2T-GSL3fKw65zQGr1ilrBBpgn9lM3B4ZhZTmebQgwPykr6gW_MbhLDr7RWmY5mBZXY3EPz9hYjaWa4qEbJDyp1NHsSCKeYWQ-9n24jMNRjeqzxPH50qQIBV2wH7lgaCgYKAToSARESFQHGX2MiqPoqBQZYeAWTQqbEYyLehA0181" $AccessToken = "ya29.a0AW4Xtxhb0o5hP7lkY1kH6ZplZy2hUlfLP1l7QDQlv8tD2T-GSL3fKw65zQGr1ilrBBpgn9lM3B4ZhZTmebQgwPykr6gW_MbhLDr7RWmY5mBZXY3EPz9hYjaWa4qEbJDyp1NHsSCKeYWQ-9n24jMNRjeqzxPH50qQIBV2wH7lgaCgYKAToSARESFQHGX2MiqPoqBQZYeAWTQqbEYyLehA0181"
$apiUrl = "https://pubsub.googleapis.com/v1/projects/$ProjectId/topics/$TopicName" $apiUrl = "https://pubsub.googleapis.com/v1/projects/$ProjectId/topics/$TopicName"
$response = $null $response = $null
@ -17,7 +17,7 @@ $body = @{
@{ @{
data = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($message)) data = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($message))
attributes = @{ attributes = @{
subject = "ARI_202209_029" subject = "ABC_202209_029"
} }
} }
) )

View File

@ -1,7 +1,7 @@
$projectId = "ari-prj-mdf-001" $projectId = "abc-prj-mdf-001"
$subscriptionName = "Alerte:pull" $subscriptionName = "Alerte:pull"
$Acknowledge = "Alerte:acknowledge" $Acknowledge = "Alerte:acknowledge"
$AccessToken = "ya29.a0AW4Xtxhr8rj3E7RdTI8EFlWlaEUYXosHFFW3ZmqC4suDspyzi5WdEkNK6xGafJxzmkan6obZjRNuV1rKNyi1MBJAVhz0HQIdjd1B2nH10pq0N9WkQNMVOQM-9SDtsI1_ubVgww1uv7lZI16MvjDOyVmHeD92KtLhb4bQJEmtQsrpEm0aCgYKAUYSARESFQHGX2MiZux4MfqHTzFxi-5xR0k_Ww0182" $AccessToken = "ya29.a0AW4Xtxhr8rj3E7RdTI8EFlWlaEFW3ZmqC4suDspyzi5WdEkNK6xGafJxzmkan6obZjRNuV1rKNyi1MBJAVhz0HQIdjd1B2nH10pq0N9WkQNMVOQM-9SDtsI1_ubVgww1uv7lZI16MvjDOyVmHeD92KtLhb4bQJEmtQsrpEm0aCgYKAUYSARESFQHGX2MiZux4MfqHTzFxi-5xR0k_Ww0182"
$response = $Null $response = $Null

View File

@ -1,5 +1,5 @@
# Variables à configurer # Variables à configurer
$Project = "ari-prj-np-mdf-001" $Project = "abc-prj-np-mdf-001"
$Topic = "MindFlow:publish" $Topic = "MindFlow:publish"
$Subscription = "Alerte:pull" $Subscription = "Alerte:pull"
$Acknowledge = "Alerte:acknowledge" $Acknowledge = "Alerte:acknowledge"
@ -11,7 +11,7 @@ $PublishUrl = "$apiUrl/projects/$project/topics/$topic"
$PullUrl = "$APIUrl/projects/$project/subscriptions/$subscription" $PullUrl = "$APIUrl/projects/$project/subscriptions/$subscription"
# Récupérer un jeton d'accès via gcloud (assurez-vous que gcloud est installé et configuré) # Récupérer un jeton d'accès via gcloud (assurez-vous que gcloud est installé et configuré)
$AccessToken = "ya29.a0AW4XtxiaBCPy6Wp2dTnjTi-W0g-tMFwMNHv_aYNzChaFOg9yH7mYliW0WDOnisy99HLwHTTEI-eV7qbkCP_oea-d1rc1SNovVPAe1fLged__1xFN0hKYtk4ZlVMUnT_fNoC7DcG88I_PdYbc0SgSgBKvoM0szcGumHlBspJYUvxcGQaCgYKAWcSARESFQHGX2MiG1rXkcIBkOLbcXfDncySPw0181" $AccessToken = "ya29.a0AW4XtxiaBCPy6Wp2dTnjTi-W0g-tMFw_aYNzChaFOg9yH7mYliW0WDOnisy99HLwHTTEI-eV7qbkCP_oea-d1rc1SNovVPAe1fLged__1xFN0hKYtk4ZlVMUnT_fNoC7DcG88I_PdYbc0SgSgBKvoM0szcGumHlBspJYUvxcGQaCgYKAWcSARESFQHGX2MiG1rXkcIBkOLbcXfDncySPw0181"
If (-not $accessToken) { If (-not $accessToken) {
Write-Error "Impossible d'obtenir un jeton d'accès. Vérifiez votre configuration gcloud." Write-Error "Impossible d'obtenir un jeton d'accès. Vérifiez votre configuration gcloud."

View File

@ -2,7 +2,7 @@
$apiUrl = "https://thcp19.aws.thehive-cloud.io/9dd3b3a0-f662-4fda-9202-06d13ba6dc90/thehive/api/v1/alert" $apiUrl = "https://thcp19.aws.thehive-cloud.io/9dd3b3a0-f662-4fda-9202-06d13ba6dc90/thehive/api/v1/alert"
$headers = @{ $headers = @{
"Authorization" = "Bearer HcWe0tq3s6m+/wRJcJmyR93W17Ave5lb" "Authorization" = "Bearer HcWe1tq3s6m+/wAYcJmyR83W17Ave5lb"
"accept" = "application/json" "accept" = "application/json"
"Content-Type" = "application/json" "Content-Type" = "application/json"
} }
@ -29,7 +29,7 @@ $body = @{
} }
@{ @{
"dataType"= "ip" "dataType"= "ip"
"data"= "82.66.77.254" "data"= "82.65.77.254"
} }
) )
} | ConvertTo-Json -Depth 10 } | ConvertTo-Json -Depth 10