From 79588f1269b5c35529209a829eb658f05ce8f50c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 18:47:55 +0000 Subject: [PATCH] Deployed 7f7685e to main with MkDocs 1.6.1 and mike 2.1.3 --- main/404.html | 2 +- main/examples/alert/index.html | 26 +++++++++++++++----------- main/examples/client/index.html | 2 +- main/index.html | 2 +- main/reference/index.html | 2 +- main/sitemap.xml.gz | Bin 127 -> 127 bytes 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/main/404.html b/main/404.html index c9ef229..65f9127 100644 --- a/main/404.html +++ b/main/404.html @@ -12,7 +12,7 @@ - + diff --git a/main/examples/alert/index.html b/main/examples/alert/index.html index 368d04a..a6e5257 100644 --- a/main/examples/alert/index.html +++ b/main/examples/alert/index.html @@ -16,7 +16,7 @@ - + @@ -919,18 +919,22 @@

An advanced alert

Fortunately we can use thehive4py's type hints to the rescue and specify more complex input alerts outside of the method call.

Here's how:

from thehive4py import TheHiveApi
+from thehive4py.types.alert import InputAlert
 
 hive = TheHiveApi(url="http://localhost:9000", apikey="h1v3b33")
 
-simple_alert = hive.alert.create(
-    alert={
-        "type": "simple",
-        "source": "tutorial",
-        "sourceRef": "should-be-unique",
-        "title": "a simple alert",
-        "description": "a bit too simple",
-    }
-)
+input_alert: InputAlert = {
+    "type": "advanced",
+    "source": "tutorial",
+    "sourceRef": "should-be-unique",
+    "title": "an advanced alert",
+    "description": "a bit more advanced",
+    "tags": ["advanced", "example"],
+    "severity": 1,
+    "caseTemplate": "my-template",
+}
+
+output_alert = hive.alert.create(alert=input_alert)
 

In the above snippet input_alert is created before the create call and later passed to the alert argument. Finally after the creation of the alert we saved the response in the output_alert to be able to use it later.

@@ -1034,7 +1038,7 @@

Add file based observables

This way TheHive will know which attachment to pair with which observable behind the scenes.

In our example attachment_key is used to specify the relationship between the observable and the actual file. In this case its value is a uuid, however it can be any arbitrary value, though it's important that it should uniquely identify the attachment and the observable we would like to pair in TheHive.

Update single and bulk

-

Sometimes an existing alert needs to be updated. TheHive offers multiple ways to accomplish this task either with a single alert or multiple ones.

+

Sometimes an existing alert needs to be updated. thehive4py offers multiple ways to accomplish this task either with a single alert or multiple ones.

Update single

A single alert can be updated using alert.update method. The method requires the alert_id of the alert to be updated and the fields to update.

import uuid
diff --git a/main/examples/client/index.html b/main/examples/client/index.html
index e99e7ec..e769fa3 100644
--- a/main/examples/client/index.html
+++ b/main/examples/client/index.html
@@ -16,7 +16,7 @@
       
       
       
-      
+      
     
     
       
diff --git a/main/index.html b/main/index.html
index d343e4e..be3eb54 100644
--- a/main/index.html
+++ b/main/index.html
@@ -14,7 +14,7 @@
       
       
       
-      
+      
     
     
       
diff --git a/main/reference/index.html b/main/reference/index.html
index 3a1b9ce..5ffe215 100644
--- a/main/reference/index.html
+++ b/main/reference/index.html
@@ -14,7 +14,7 @@
       
       
       
-      
+      
     
     
       
diff --git a/main/sitemap.xml.gz b/main/sitemap.xml.gz
index 8f2bbf57c823a26f80a69dd6cdd1f1e7cb7c1f01..b251d309b96f88a0f4fc8af5654d43d02f3e5d9a 100644
GIT binary patch
delta 13
Ucmb=gXP58h;9&4HoXB1Q02jOiN&o-=

delta 13
Ucmb=gXP58h;9z(yHj%vo02+D&(EtDd