Skip to content

Nbensalmon/ciac 13043/collection extrahop reveal x #39545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
95d6955
Creating integration for ExtrahopRevealXEventCollector
nbensalm-palo Mar 25, 2025
9bf2d39
Changing to extrahop png
nbensalm-palo Mar 26, 2025
7f661b0
IMplementing the integration Configuration params in yml file
nbensalm-palo Mar 26, 2025
22215af
Finish First Draft of Collector .yml
nbensalm-palo Mar 26, 2025
7ffae6b
Finish First Draft of Collector extrahop collector
nbensalm-palo Mar 26, 2025
517eeb3
Start implement Event collector design
nbensalm-palo Mar 27, 2025
04613bc
Finish Implementing fetch-events function
nbensalm-palo Mar 27, 2025
f0d2efd
Niv Adding more fixes to ExtrahopRevealXEventCollector.py
nbensalm-palo Apr 6, 2025
07876da
Merge branch 'master' into nbensalmon/CIAC-13043/Collection_Extrahop_…
nbensalm-palo Apr 6, 2025
02a605e
Finish Fetch event logic accoridn to design changes
nbensalm-palo Apr 6, 2025
08f70fa
Finish Fetch event logic accoridng to design changes
nbensalm-palo Apr 6, 2025
52092fe
Finish Get Events
nbensalm-palo Apr 7, 2025
d7c7e26
Finish test module
nbensalm-palo Apr 7, 2025
78f5dd2
Creating Help part
nbensalm-palo Apr 7, 2025
cbc2f0e
Updating server-url and output
nbensalm-palo Apr 7, 2025
1063bf1
Improving Get-events commands in collector
nbensalm-palo Apr 7, 2025
2ae0357
Adding Command Examples
nbensalm-palo Apr 7, 2025
f05565f
Another changes
nbensalm-palo Apr 7, 2025
a48aa62
Refactoring code to make it look better
nbensalm-palo Apr 8, 2025
5f5913d
Changing limit to max_events in code
nbensalm-palo Apr 8, 2025
7870919
Fixing command_results
nbensalm-palo Apr 8, 2025
cf62994
Removing first_fetch from get events
nbensalm-palo Apr 8, 2025
ce434b5
Updated the descriptions files
nbensalm-palo Apr 8, 2025
99755ef
Merge branch 'master' into nbensalmon/CIAC-13043/Collection_Extrahop_…
nbensalm-palo Apr 8, 2025
f106648
Returning first fetch to get - events
nbensalm-palo Apr 8, 2025
182f418
Fixing setLastRun bug
nbensalm-palo Apr 8, 2025
ec6d0fe
Another small changes in code
nbensalm-palo Apr 8, 2025
2badc3e
Fixing out of range bug
nbensalm-palo Apr 8, 2025
d06126b
Fixing Checking Version BUg
nbensalm-palo Apr 9, 2025
5e44cb6
Adding tests and fixing code according to tests
nbensalm-palo Apr 9, 2025
a0ffb94
Adding test data
nbensalm-palo Apr 9, 2025
3829480
Deleting old file
nbensalm-palo Apr 9, 2025
10e4324
Updating test file
nbensalm-palo Apr 9, 2025
cbd5680
Changing syntax in the code to pass pre commit
nbensalm-palo Apr 9, 2025
ef094a1
Changing yml file after validation in pre commit
nbensalm-palo Apr 10, 2025
68cb477
Define defaultDataSource in pack meta data
nbensalm-palo Apr 10, 2025
5175453
Merge branch 'master' into nbensalmon/CIAC-13043/Collection_Extrahop_…
nbensalm-palo Apr 10, 2025
a25a098
update description of params to pass the validation
nbensalm-palo Apr 10, 2025
7131067
Adding notes before PR
nbensalm-palo Apr 10, 2025
123b53a
Adding relevant data to description files and yml file
nbensalm-palo Apr 10, 2025
41006ca
Update Readme according to official docs
nbensalm-palo Apr 10, 2025
e5d20e3
Integration update-release-notes
nbensalm-palo Apr 10, 2025
e89898e
Updating release notes
nbensalm-palo Apr 10, 2025
5b7945c
Change in test data because failed secrets
nbensalm-palo Apr 10, 2025
0d98e96
Change Display name to event Collector
nbensalm-palo Apr 10, 2025
7adbb9d
Update release notes
nbensalm-palo Apr 10, 2025
a1b748a
Updated to credentials instead of key and secret
nbensalm-palo Apr 10, 2025
99ecdbc
Update release notes version
nbensalm-palo Apr 14, 2025
9594cf7
Removing extrahop version check in code
nbensalm-palo Apr 14, 2025
77d7804
Removing Extrahop version check in code - update tests
nbensalm-palo Apr 14, 2025
16a4cf6
Update get events args and the events max event logic
nbensalm-palo Apr 14, 2025
125503b
Merge branch 'master' into nbensalmon/CIAC-13043/Collection_Extrahop_…
nbensalm-palo Apr 17, 2025
9384ca8
Changes After Commit notes
nbensalm-palo Apr 17, 2025
4f63fb9
Changes After Commit notes
nbensalm-palo Apr 17, 2025
7f7cec5
Changes After Commit notes
nbensalm-palo Apr 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
category: Analytics & SIEM
sectionorder:
- Connect
- Collect
commonfields:
id: ExtrahopRevealXEventCollector
version: -1
configuration:
- display: Server URL
name: server_url
required: true
type: 0
section: Connect
- additionalinfo: The Client Credentials (ID, Secret) generated on your ExtraHop system that is required for authentication if connecting to ExtraHop Reveal(x) 360.
displaypassword: Client Secret
display: Client ID
name: credentials
required: true
type: 9
section: Connect
- display: Trust any certificate (not secure)
name: insecure
required: false
type: 8
section: Collect
advanced: true
- display: Use system proxy settings
name: proxy
required: false
type: 8
section: Collect
advanced: true
- display: Fetch events
name: isFetchEvents
type: 8
section: Collect
required: false
hidden:
- xsoar
defaultvalue: "true"
- additionalinfo: 'Defines the maximum number of audits events per fetch cycle. Default value: 25000.'
defaultvalue: "25000"
display: Maximum number of events per fetch
name: max_events_per_fetch
required: true
type: 0
section: Collect
advanced: true
description: ExtraHop Reveal(x) is a network detection and response solution that provides complete visibility of network communications at enterprise scale, real-time threat detections backed by machine learning, and guided investigation workflows that simplify response.
display: ExtraHop Reveal(x) Event Collector
name: ExtrahopRevealXEventCollector
supportlevelheader: xsoar
script:
commands:
- name: revealx-get-events
description: Retrieves a list of audit logs events from the Extrahop RevealX instance.
arguments:
- auto: PREDEFINED
defaultValue: 'false'
description: Set this argument to true in order to create events, otherwise it will only display them.
name: should_push_events
predefined:
- 'true'
- 'false'
required: true
- description: Returns no more than the specified number of detections.
name: limit
required: false
- description: "The UTC date or relative timestamp from where to start fetching incidents
Supported formats: N minutes, N hours, N days, N weeks, N months, N years, yyyy-mm-dd, yyyy-mm-ddTHH:MM:SSZ."
name: first_fetch
required: false
isfetch: false
runonce: false
script: '-'
type: python
subtype: python3
isfetchevents: true
dockerimage: demisto/python3:3.12.8.1983910
fromversion: 6.10.0
marketplaces:
- marketplacev2
tests:
- No tests (auto formatted)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Configure an instance for ExtraHop Reveal(x)

### How to create REST API Credentials:
* You must have system and access administration privileges.
1. Log in to RevealX 360.
2. Click the System Settings icon - at the top right of the page and then click All Administration.
3. Click API Access.
4. Click Create Credentials.
5. In the Name field, type a name for the credentials.
6. In the Privileges field, specify a privilege level for the credentials. The privilege level determines which actions can be performed with the credential. Do not grant more privileges to REST API credentials than needed because it can create a security risk. For example, applications that only retrieve metrics should not be granted credentials that grant administrative privileges. For more information about each privilege level, see User privileges.
* Note: System and Access Administration privileges are similar to Full write privileges and allow the credentials to connect sensors and Trace appliances to RevealX 360.*
7. In the Packet Access field, specify whether you can retrieve packets and session keys with the credentials.
8. Click Save. The Copy REST API Credentials pane appears.
9. Under ID, click Copy to Clipboard and save the ID to your local machine.
10. Under Secret, click Copy to Clipboard and save the secret to your local machine.
11. Click Done.



Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import pytest

from ExtrahopRevealXEventCollector import Client
from CommonServerPython import *

MOCK_BASEURL = "https://example.com"
MOCK_CLIENT_ID = "ID"
MOCK_CLIENT_SECRET = "SECRET"
OK_CODES = (200, 201, 204)


def util_load_json(path):
with open(path, encoding="utf-8") as f:
return json.loads(f.read())


@pytest.fixture
def client():
return Client(
base_url=MOCK_BASEURL,
verify=False,
client_id=MOCK_CLIENT_ID,
client_secret=MOCK_CLIENT_SECRET,
use_proxy=False,
ok_codes=OK_CODES
)


def test_update_time_values_detections():
"""
Given: A mock raw response containing detections logs.
When: Updating time fields
Then: Ensure the events are added the new time fields
"""
from ExtrahopRevealXEventCollector import update_time_values_detections
raw_detections = util_load_json("test_data/detections-dummy.json")
update_time_values_detections(raw_detections)

for detection in raw_detections:
assert "_TIME" in detection
assert "_ENTRY_STATUS" in detection



def test_fetch_events_update_last_run(client, mocker):
"""
Given: A mock raw response containing detections logs.
When: fetching events.
Then: Make sure that the last run object was updated as expected
"""
from ExtrahopRevealXEventCollector import fetch_events
raw_detections = util_load_json("test_data/detections-dummy.json")
mocker.patch("ExtrahopRevealXEventCollector.Client.detections_list", return_value=raw_detections)

output, new_last_run = fetch_events(client, last_run={}, max_events=len(raw_detections))

assert len(output) == 5
assert new_last_run.get("offset") == 0
assert new_last_run.get("detection_start_time") == raw_detections[-1]["mod_time"] + 1


def test_fetch_events_already_fetched(client, mocker):
"""
Given: A mock raw response containing detections events.
When: Fetching events that was already fetched
Then: Ensure the function does not return any events
"""
from ExtrahopRevealXEventCollector import fetch_events
raw_detections = util_load_json("test_data/detections-dummy.json")
mocker.patch("ExtrahopRevealXEventCollector.Client.detections_list", return_value=raw_detections)

mock_already_fetched = [d["id"] for d in raw_detections]
last_run_mock = {"already_fetched": mock_already_fetched}

output, new_last_run = fetch_events(client, last_run=last_run_mock, max_events=len(raw_detections))

assert len(output) == 0
assert new_last_run.get("already_fetched") == mock_already_fetched


def test_fetch_events_reaching_limit(client, mocker):
"""
Given: A mock raw response containing detections events.
When: Fetching events with a fetch limit higher than the number of available logs.
Then: Ensure the function returns exactly the requested number of events and updates the last run timestamp correctly.
"""
from ExtrahopRevealXEventCollector import fetch_events
raw_detections = util_load_json("test_data/detections-dummy.json")[:-2]
mocker.patch("ExtrahopRevealXEventCollector.Client.detections_list", return_value=raw_detections)

output, new_last_run = fetch_events(client, last_run={}, max_events=len(raw_detections) + 2)

assert len(output) == len(raw_detections)
assert new_last_run.get("detection_start_time") == raw_detections[-1]["mod_time"] + 1


def test_fetch_events_more_than_exist(client, mocker):
"""
Given: A mock raw response containing detections events.
When: Fetching events with a fetch limit smaller than the number of available logs.
Then: Ensure the function returns exactly the requested number of events and updates the last run timestamp correctly.
"""
from ExtrahopRevealXEventCollector import fetch_events
raw_detections = util_load_json("test_data/detections-dummy.json")
mocker.patch("ExtrahopRevealXEventCollector.Client.detections_list", return_value=raw_detections)

output, new_last_run = fetch_events(client, last_run={}, max_events=len(raw_detections) - 2)

assert len(output) == len(raw_detections) - 2
assert new_last_run.get("detection_start_time") == raw_detections[-3]["mod_time"] + 1


def test_fetch_events_same_mod_time(client, mocker):
"""
Given: A mock raw response containing detections events.
When: Fetching events with a fetch limit less than the number of available logs and they all have the same mod_time
Then: Ensure the function returns exactly the requested number of events and updates the last run timestamp correctly.
"""
from ExtrahopRevealXEventCollector import fetch_events
raw_detections = util_load_json("test_data/detections-dummy.json")
mod_time_all = 1000
for d in raw_detections:
d["mod_time"] = mod_time_all

mocker.patch("ExtrahopRevealXEventCollector.Client.detections_list", return_value=raw_detections)

output, new_last_run = fetch_events(client, last_run={}, max_events=len(raw_detections) - 2)

assert len(output) == len(raw_detections) - 2
assert new_last_run.get("detection_start_time") == mod_time_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ExtraHop Reveal(x) is a network detection and response solution that provides complete visibility of network communications at enterprise scale, real-time threat detections backed by machine learning, and guided investigation workflows that simplify response.
#### This integration works with ExtraHop firmware version greater than or equal to 9.3.0

## Configure an instance for ExtraHop Reveal(x)

### How to create REST API Credentials:
* You must have system and access administration privileges.
1. Log in to RevealX 360.
2. Click the System Settings icon - at the top right of the page and then click All Administration.
3. Click API Access.
4. Click Create Credentials.
5. In the Name field, type a name for the credentials.
6. In the Privileges field, specify a privilege level for the credentials. The privilege level determines which actions can be performed with the credential. Do not grant more privileges to REST API credentials than needed because it can create a security risk. For example, applications that only retrieve metrics should not be granted credentials that grant administrative privileges. For more information about each privilege level, see User privileges.
* Note: System and Access Administration privileges are similar to Full write privileges and allow the credentials to connect sensors and Trace appliances to RevealX 360.*
7. In the Packet Access field, specify whether you can retrieve packets and session keys with the credentials.
8. Click Save. The Copy REST API Credentials pane appears.
9. Under ID, click Copy to Clipboard and save the ID to your local machine.
10. Under Secret, click Copy to Clipboard and save the secret to your local machine.
11. Click Done.


## Configure ExtraHop Reveal(x) in Cortex


| **Parameter** | **Description** | **Required** |
| --- | --- | --- |
| Your server URL | | True |
| Client Id | The client ID generated on your ExtraHop system that is required for authentication if connecting to ExtraHop Reveal\(x\) 360. | True |
| Client Secret | The client secret generated on your ExtraHop system that is required for authentication if connecting to ExtraHop Reveal\(x\) 360. | True |
| Trust any certificate (not secure) | | False |
| Use system proxy settings | | False |
| Fetch events | | False |
| Maximum number of events per fetch | Defines the maximum number of audits events per fetch cycle. Default value: 25000. | True |

## 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.

### revealx-get-events

***
Retrieves a list of audit logs events from the Extrahop RevealX instance.

#### Base Command

`revealx-get-events`

#### Input

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| should_push_events | Set this argument to true in order to create events, otherwise it will only display them. Possible values are: true, false. Default is false. | Required |
| max_events | Returns no more than the specified number of detections. | Optional |

#### Context Output

There is no context output for this command.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!revealx-get-events should_push_events=false limit=10 first_fetch="1 days"
Loading
Loading