Arcanna.AI
Arcanna integration for using the power of AI in SOC.
Data Enrichment & Threat Intelligence · ArcannaAI
Details
| ID | Arcanna.AI |
|---|---|
| Provider | Arcanna.ai INC |
| Category | Data Enrichment & Threat Intelligence |
| From Version | 5.5.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Supported Modules | Agentix XSIAM |
README
Arcanna integration for using the power of AI in SOC
This integration was integrated and tested with version 1.45.1 of Arcanna.AI
Configure Arcanna.AI in Cortex
| Parameter | Description | Required |
|---|---|---|
| Server URL (e.g. https://<your arcanna ai api>) | URL of Arcanna API | True |
| API Key | Api Key for Arcanna API | True |
| Trust any certificate (not secure) | False | |
| Use system proxy settings | False | |
| Default Arcanna Job Id | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
arcanna-get-jobs
Get jobs list
Base Command
arcanna-get-jobs
Input
There are no input arguments for this command.
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Jobs.job_id | Number | Arcanna Job id |
| Arcanna.Jobs.data_type | String | Arcanna Job type |
| Arcanna.Jobs.title | String | Arcanna Job title |
| Arcanna.Jobs.status | String | Arcanna job status |
| Arcanna.Jobs.last_processed_timestamp | date | Last processed time |
Command Example
#### Context Example
```json
{
"Arcanna": {
"Jobs": [
{
"data_type": "",
"job_id": 1201,
"status": "STARTED",
"title": "dev1"
},
{
"data_type": "",
"job_id": 1202,
"status": "STARTED",
"title": "marian-demo"
}
]
}
}
Human Readable Output
Arcanna Jobs
job_id title data_type status 1201 dev1 STARTED 1202 marian-demo STARTED
arcanna-send-event
Sends a raw event to Arcanna
Base Command
arcanna-send-event
Input
| Argument Name | Description | Required |
|---|---|---|
| job_id | An Arcanna running job_id. | Optional |
| event_json | json event for arcanna to inference. | Required |
| title | event title. | Required |
| severity | event severity. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Event.event_id | Number | Arcanna event id |
| Arcanna.Event.status | String | Arcanna ingestion status |
| Arcanna.Event.ingest_timestamp | date | Arcanna ingestion timestamp |
| Arcanna.Event.error_message | String | Arcanna error message if any |
| Arcanna.Event.job_id | Number | An Arcanna Job id used for sending. |
Command Example
!arcanna-send-event job_id=1202 event_json="{\"destination\":{ \"address\":\"10.128.0.6\", \"port\":53720, \"bytes\":836035, \"ip\":\"10.128.0.6\", \"packets\":6459},\"rule\":{ \"name\":\"SURICATA HTTP unable to match response to request\", \"id\":\"2221010\", \"category\":\"Generic Protocol Command Decode\"},\"source\":{ \"address\":\"8.8.8.8\", \"port\":9200, \"bytes\":4833843, \"ip\":\"8.8.8.8\", \"packets\":9677},\"event\":{ \"severity\":3, \"ingested\":\"2021-06-15T07:56:50.654225827Z\", \"created\":\"2021-06-15T07:56:49.649Z\", \"kind\":\"alert\", \"module\":\"suricata\", \"start\":\"2021-06-14T14:02:06.280Z\", \"category\":[ \"network\", \"intrusion_detection\" ], \"type\":[ \"allowed\" ], \"dataset\":\"suricata.eve\"},\"fileset\":{ \"name\":\"eve\"},\"message\":\"Generic Protocol Command Decode\",\"url\":{ \"path\":\"/libhtp::request_uri_not_seen\", \"original\":\"/libhtp::request_uri_not_seen\"},\"@timestamp\":\"2021-06-15T07:56:49.647Z\",\"suricata\":{ \"eve\":{ \"in_iface\":\"ens4\", \"metadata\":{ \"flowints\":{ \"http.anomaly.count\":2419 } }, \"event_type\":\"alert\", \"alert\":{ \"signature_id\":2221010, \"rev\":1, \"gid\":1, \"signature\":\"SURICATA HTTP unable to match response to request\", \"category\":\"Generic Protocol Command Decode\" }, \"flow_id\":576330410117303, \"tx_id\":3224, \"flow\":{ } }}}" title=Test_alert severity=3
Context Example
{
"Arcanna": {
"Event": {
"error_message": "",
"event_id": "12023636421762",
"ingest_timestamp": "2021-09-02T09:46:22.363642Z",
"job_id": 1202,
"status": "Pending inference"
}
}
}
Human Readable Output
{‘event_id’: ‘12023636421762’, ‘job_id’: 1202, ‘ingest_timestamp’: ‘2021-09-02T09:46:22.363642Z’, ‘status’: ‘Pending inference’, ‘error_message’: ‘’}
arcanna-trigger-train
Trigger AI Train for specified Arcanna.ai Job.
Base Command
arcanna-trigger-train
Input
| Argument Name | Description | Required |
|---|---|---|
| job_id | Job ID to trigger train for. | Required |
| username | Username for audit. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Train.status | String | Action status. |
| Arcanna.Train.error_message | String | Message in case of error. |
Command Example
!arcanna-trigger-train job_id="1201" username="admin"
Context Example
{
"status": "OK",
"error_message": ""
}
Human Readable Output
Arcanna trigger train results: {‘status’: ‘OK’, ‘error_message’: ‘’}
arcanna-get-decision-set
Retrieve avaiable decision points for specified AI Job.
Base Command
arcanna-get-decision-set
Input
| Argument Name | Description | Required |
|---|---|---|
| job_id | Job ID to use for exporting event. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Event.decision_set | List | Available decisions for specified AI Job. |
Command Example
!arcanna-get-decision-set job_id="1201"
Context Example
{
"decision_set": ["Drop", "Escalate"]
}
Human Readable Output
Arcanna get decision set results: {‘decision_set’: [‘Drop’,’Escalate’]}
arcanna-export-event
Export full event with metadata from Arcanna.ai based on specified Job ID and Event ID.
Base Command
arcanna-export-event
Input
| Argument Name | Description | Required |
|---|---|---|
| job_id | Job ID to use for exporting event. | Required |
| event_id | Event ID to use for exporting event. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Event.arcanna_event | unknown | Full export for specified event. |
Command Example
!arcanna-export-event job_id="1201" event_id="12011938471583"
Context Example
{
"result": "Escalate with Priority",
"metadata": {
"id": "12011938471583",
...
}
...
}
Human Readable Output
Arcanna export event results: {‘result’: ‘Escalate with Priority’, ‘metadata’: {‘id’: ‘12011938471583’, .. }, ..}
arcanna-get-event-status
Retrieves Arcanna Inference result.
Base Command
arcanna-get-event-status
Input
| Argument Name | Description | Required |
|---|---|---|
| job_id | Arcanna Job Id. | Optional |
| event_id | Arcanna generated unique event id. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Event.event_id | String | Arcanna event id |
| Arcanna.Event.ingest_timestamp | String | Arcanna ingestion timestamp. |
| Arcanna.Event.result | String | Arcanna event result |
| Arcanna.Event.error_message | String | Arcanna error message if any. |
| Arcanna.Event.status | String | Arcanna event status. |
| Arcanna.Event.result_label | String | Arcanna event result label |
| Arcanna.Event.is_duplicated | boolean | Deprecated. Arcanna signalling if event is duplicated by another alert. |
| Arcanna.Event.confidence_level | Number | Deprecated. Arcanna ML confidence_level |
| Arcanna.Event.confidence_score | Number | Arcanna ML confidence_score |
| Arcanna.Event.bucket_state | String | Flag to indicate the current event’s state in the AI Model |
| Arcanna.Event.outlier | boolean | Arcanna signalling if event is an outlier based on historical data |
Command Example
!arcanna-get-event-status job_id="1201" event_id="12011938471583"
Context Example
{
"Arcanna": {
"Event": {
"confidence_score": 0.9999464750289917,
"error_message": null,
"event_id": "12011938471583",
"ingest_timestamp": "2021-08-26T12:53:47.193847Z",
"result": "escalate_alert",
"result_label": "Escalate",
"outlier": False
"status": "OK"
}
}
}
Human Readable Output
{‘event_id’: ‘12011938471583’, ‘ingest_timestamp’: ‘2021-08-26T12:53:47.193847Z’, ‘status’: ‘OK’, ‘confidence_score’: 0.9999464750289917, ‘result’: ‘escalate_alert’, ‘result_label’: ‘Escalate’, ‘outlier’: False, ‘error_message’: None}
arcanna-send-event-feedback
Send Arcanna feedback for a previous inferred event.
Base Command
arcanna-send-event-feedback
Input
| Argument Name | Description | Required |
|---|---|---|
| job_id | An Arcanna job id. | Optional |
| event_id | An Arcanna event id. | Required |
| feedback | An Arcanna feedback label. | Required |
| username | A username providing the feedback. | Required |
| decision_set | List of possible decisions to be used as feedback values. | Required |
| closing_notes | Deprecated. Prior used for audit. | Optional |
| label | Deprecated. Replaced by feedback. |
Required |
| indicators | Deprecated. Prior used for metadata. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Arcanna.Event.feedback_status | String | An Arcanna feedback status response. |
Command Example
!arcanna-send-event-feedback job_id="1201" event_id="12011938471583" feedback="Escalate with Priority" username="dbot"
Context Example
{
"Arcanna": {
"Event": {
"status": "updated"
}
}
}
Human Readable Output
Arcanna send event feedback results: {‘status’: ‘updated’}
Configuration parameters
url— Server URL (e.g. https://<your arcanna ai api>/ ) (required)credentials— Authenticationapikey— API Key ( Deprecated )ssl_verification— SSL Certificate verificationinsecure— Trust any certificate (not secure)proxy— Use system proxy settingsfeature_mapping— A closing reason to Arcanna labels (deprecated).closing_reason_field— Alert closing reasondefault_job_id— Default Arcanna Job Id
Commands (11)
-
arcanna-export-eventExport full event with metadata from Arcanna.ai based on specified Job ID and Event ID.
-
arcanna-get-decision-setRetrieve avaiable decision points for specified AI Job.
-
arcanna-get-default-job-idDeprecatedRetrieves Arcanna Default Job id.
-
arcanna-get-event-statusRetrieves Arcanna Inference result.
-
arcanna-get-feedback-fieldDeprecatedReturns the Feedback field set on integration.
-
arcanna-get-jobsGet jobs list.
-
arcanna-send-bulk-eventsDeprecatedSend to Arcanna a bulk of events as a dict encoded JSON string filled with XSOAR fields.
-
arcanna-send-eventSends a raw event to Arcanna.
-
arcanna-send-event-feedbackSend Arcanna feedback for a previous inferred event.
-
arcanna-set-default-job-idDeprecatedSets Arcanna Default Job id.
-
arcanna-trigger-trainTrigger AI Train for specified Arcanna.ai Job.
import json import demistomock as demisto from ArcannaAI import Client, get_decision_set, get_event_status, get_jobs, post_event, send_event_feedback, trigger_training client = Client(base_url="demisto.con", verify=False, proxy=False, headers={}) def util_load_json(path): with open(path, encoding="utf-8") as f: return json.loads(f.read()) connection_json = {"connected": True} arcanna_get_decision_set_response = ["Drop", "Escalate"] arcanna_trigger_train_response = {"status": "OK", "error_message": ""} arcanna_inference_response = { "event_id": "11013867751676", "ingest_timestamp": "2021-06-30T13:57:47.386775", "status": "OK", "confidence_level": 0.9961161017417908, "result": "escalate_alert", "is_duplicated": True, "error_message": "", } arcanna_ingest_response = { "event_id": "20198", "ingest_timestamp": "2021-07-01T07:58:03.801992", "status": "Pending inference", "error_message": "", } arcanna_jobs_response = [ {"job_id": 1, "data_type": "a", "title": "cortex", "status": "STARTED"}, {"job_id": 2, "data_type": "palo", "title": "cortex5", "status": "IDLE"}, ] arcanna_event_feedback_response = {"status": "updated"} def test_arcanna_get_jobs_command(mocker): mocker.patch.object(client, "list_jobs", return_value=arcanna_jobs_response) command_result = get_jobs(client) assert len(command_result.raw_response) == 2 assert command_result.raw_response[0]["job_id"] == 1 assert command_result.raw_response[0]["status"] == "STARTED" assert command_result.raw_response[1]["job_id"] == 2 assert command_result.raw_response[1]["status"] == "IDLE" def test_arcanna_send_event_command(mocker): mocker.patch.object(client, "send_raw_event", return_value=arcanna_ingest_response) command_args = { "job_id": 10, "event_json": '{"offset": 1739561255, "destination": "127.0.0.1"}', "severity": 3, "title": "Incident id #20198", "id_value": "20198", } mocker.patch.object(demisto, "args", return_value=command_args) command_result = post_event(client, 1201, command_args) assert command_result.raw_response["event_id"] == "20198" assert command_result.raw_response["error_message"] == "" assert command_result.raw_response["status"] == "Pending inference" def test_arcanna_get_decision_set(mocker): mocker.patch.object(client, "get_decision_set", return_value=arcanna_get_decision_set_response) command_args = {"job_id": 10} mocker.patch.object(demisto, "args", return_value=command_args) command_result = get_decision_set(client, 1201, command_args) assert isinstance(command_result.raw_response, list) assert "Drop" in command_result.raw_response def test_arcanna_trigger_train(mocker): mocker.patch.object(client, "trigger_training", return_value=arcanna_trigger_train_response) command_args = {"job_id": 10, "username": "myusername"} mocker.patch.object(demisto, "args", return_value=command_args) command_result = trigger_training(client, 1201, command_args) assert command_result.raw_response["status"] == "OK" assert command_result.raw_response["error_message"] == "" def test_arcanna_get_event_status_command(mocker): mocker.patch.object(client, "get_event_status", return_value=arcanna_inference_response) command_args = {"job_id": 10, "event_id": "11013867751676", "polling": "false", "interval": 10, "timeout": 60} mocker.patch.object(demisto, "args", return_value=command_args) command_result = get_event_status(command_args, client, 1201) assert command_result.raw_response["status"] == "OK" assert command_result.raw_response["result"] == "escalate_alert" def test_arcanna_send_event_feedback_command(mocker): mocker.patch.object(client, "send_feedback", return_value=arcanna_event_feedback_response) command_args = { "job_id": 10, "event_id": 10110011, "feedback": "Escalate", "decision_set": ["Drop", "Escalate"], "username": "dbot", } mocker.patch.object(demisto, "args", return_value=command_args) command_result = send_event_feedback(client=client, default_job_id=1201, args=command_args) assert command_result.raw_response["status"] == "updated"