HelloWorldEventCollector

This is the Hello World event collector integration for Cortex XSIAM.

Analytics & SIEM · HelloWorld

Details

IDHelloWorldEventCollector
ProviderOpen Source
CategoryAnalytics & SIEM
From Version8.4.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM Exposure Management

README

This is the Hello World event collector integration for XSIAM.

This is the default integration for this content pack when configured by the Data Onboarder in Cortex XSIAM.

Configure HelloWorld Event Collector on Cortex XSOAR

  1. Navigate to Settings > Integrations > Servers & Services.
  2. Search for HelloWorld Event Collector.
  3. Click Add instance to create and configure a new integration instance.

    Parameter Required
    Server URL False
    Fetch alerts with status (ACTIVE, CLOSED) False
    Max number of events per fetch False
    Trust any certificate (not secure) False
    Use system proxy settings False
  4. Click Test to validate the URLs, token, and connection.

Commands

You can execute these commands from the Cortex XSOAR 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.

hello-world-get-events


Gets events from Hello World.

Base Command

hello-world-get-events

Input

Argument Name Description Required
should_push_events If true, the command will create events, otherwise it will only display them. Possible values are: true, false. Default is false. Required
status Filter by alert status. Possible values are: ACTIVE, CLOSED. Optional
limit Maximum number of results to return. Required
from_date Date from which to get events. Optional

Context Output

There is no context output for this command.

Configuration parameters

  • url — Server URL
  • alert_status — Fetch alerts with status (ACTIVE, CLOSED)
  • max_events_per_fetch — Max number of events per fetch
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings

Commands (1)

  • hello-world-get-events

    Gets events from Hello World.

from HelloWorldEventCollector import Client, fetch_events, get_events


def test_fetch_detection_events_command():
    """
    Given:
    - fetch events command (fetches detections)

    When:
    - Running fetch-events command

    Then:
    - Ensure number of events fetched, and next run fields
    """
    first_fetch_str = "2022-12-21T03:42:05Z"
    base_url = "https://server_url/"
    client = Client(
        base_url=base_url,
        verify=True,
        proxy=False,
    )
    last_run = {"prev_id": 1}
    next_run, events = fetch_events(
        client=client,
        last_run=last_run,
        first_fetch_time=first_fetch_str,
        alert_status="Status",
        max_events_per_fetch=1,
    )

    assert len(events) == 1
    assert next_run.get("prev_id") == 2
    assert events[0].get("id") == 2


def test_test_module_command():
    """
    Given:
    - test module command (fetches detections)

    When:
    - Pressing test button

    Then:
    - Test module passed
    """
    from HelloWorldEventCollector import test_module

    first_fetch_str = "2022-12-21T03:42:05Z"
    base_url = "https://server_url/"
    client = Client(
        base_url=base_url,
        verify=True,
        proxy=False,
    )
    res = test_module(
        client=client,
        params={},
        first_fetch_time=first_fetch_str,
    )

    assert res == "ok"


def test_get_events_command():
    """
    Given:
    - get_events command (fetches detections)

    When:
    - running get events command

    Then:
    - events and human readable as expected
    """
    base_url = "https://server_url/"
    client = Client(
        base_url=base_url,
        verify=True,
        proxy=False,
    )
    events, hr = get_events(
        client=client,
        alert_status="Some Status",
        args={},
    )

    assert events[0].get("id") == 1
    assert "Test Event" in hr.readable_output