Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion stream/qradar/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- OPENCTI_URL=http://localhost
- OPENCTI_TOKEN=ChangeMe
- CONNECTOR_ID=ChangeMe
- CONNECTOR_LIVE_STREAM_ID=live # ID of the live stream created in the OpenCTI UI
- CONNECTOR_LIVE_STREAM_ID=changeme # ID of the live stream created in the OpenCTI UI
- CONNECTOR_LIVE_STREAM_LISTEN_DELETE=true
- CONNECTOR_LIVE_STREAM_NO_DEPENDENCIES=true
- CONNECTOR_NAME=OpenCTI QRADAR Connector
Expand Down
2 changes: 1 addition & 1 deletion stream/qradar/src/config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ opencti:
connector:
id: 'ChangeMe'
type: 'STREAM'
live_stream_id: 'live' # ID of the live stream created in the OpenCTI UI
live_stream_id: 'changeme' # ID of the live stream created in the OpenCTI UI
live_stream_listen_delete: true
live_stream_no_dependencies: true
name: 'QRadar'
Expand Down
12 changes: 12 additions & 0 deletions stream/qradar/src/qradar.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ def __init__(self):
)
sys.exit(0)

def check_stream_id(self):
"""
In case of stream_id configuration is missing, raise ValueError
"""
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass should be removed

if (
not self.helper.connect_live_stream_id
or self.helper.connect_live_stream_id.lower() == "changeme"
):
raise ValueError("Missing stream ID, please check your configurations.")

def _initialize_reference_sets(self):
"""
:return:
Expand Down Expand Up @@ -367,6 +378,7 @@ def _process_message(self, msg):
return None

def start(self):
self.check_stream_id()
self.helper.listen_stream(self._process_message)


Expand Down