Skip to content
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

[RST Noise Control] unsupported operand type(s) for +: 'NoneType' and 'str' #3225

Closed
dominictory opened this issue Jan 7, 2025 · 4 comments
Labels
bug use for describing something not working as expected needs more info Intel needed about the use case solved use to identify issue that has been solved (must be linked to the solving PR)

Comments

@dominictory
Copy link

Description

RST Noise Control is producing errors and failing to enrich indicators.

ERROR Error in message processing, reporting error to API | timestamp=2025-01-07T13:42:20.671680Z name=RST Noise Control exc_info=Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pycti/connector/opencti_connector_helper.py", line 360, in _data_handler
    message = self.callback(event_data)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/opencti-connector-noisecontrol/main.py", line 236, in _process_message
    url = self.base_url + "/benign/lookup"
          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' taskName=null

Environment

6.4.5

Reproducible Steps

Integrate RST Noise Control connector in 6.4.5
Set ...AUTO=True
Set ...Scope=Indicator

Expected Output

Connector enriches indicator

Actual Output

Connector fails to enrich indicator

@dominictory dominictory added bug use for describing something not working as expected needs triage use to identify issue needing triage from Filigran Product team labels Jan 7, 2025
@romain-filigran
Copy link
Member

Hi @dominictory : It seems that the variable "self.base_url" is None. Do you have correctly configured the configuration file ?
Can you share your connector configuration ?

@romain-filigran romain-filigran added needs more info Intel needed about the use case and removed needs triage use to identify issue needing triage from Filigran Product team labels Jan 7, 2025
@dominictory
Copy link
Author

Hi @dominictory : It seems that the variable "self.base_url" is None. Do you have correctly configured the configuration file ? Can you share your connector configuration ?

Hi, I have configured all mandatory options as per https://github.com/OpenCTI-Platform/connectors/tree/master/internal-enrichment/rst-noise-control:

connector-rst-noise-control:
image: opencti/connector-rst-noise-control:${OPENCTI_VERSION}
environment:
- OPENCTI_URL=http://opencti-connector:8080
- OPENCTI_TOKEN=a8525a4c-b029-4c20-8ba5-b695cf4d1eb4
- CONNECTOR_ID=3a3be5a8-775c-4b11-b7a8-6373ac7cd844
- CONNECTOR_NAME=RST Noise Control
- CONNECTOR_SCOPE=Indicator
- CONNECTOR_AUTO=false
- CONNECTOR_LOG_LEVEL=error
- RST_NOISE_CONTROL_API_KEY=${RST_API_KEY}
- RST_NOISE_CONTROL_MAX_TLP=TLP:AMBER+STRICT
restart: always

The configuration is basically the same as my other RST connectors, the default base URL is fine so have left that out. Do I need to explicitly state it in this connector?

@romain-filigran
Copy link
Member

Hi @dominictory. Despite the fact that the “RST_NOISE_CONTROL_BASEURL” is documented as not required, it would seem that it is necessary.
The code does not seem to initialize with a default value.
https://github.com/OpenCTI-Platform/connectors/blob/master/internal-enrichment/rst-noise-control/src/main.py#L25
Can you test by configuring this variable?

@dominictory
Copy link
Author

Hi @dominictory. Despite the fact that the “RST_NOISE_CONTROL_BASEURL” is documented as not required, it would seem that it is necessary. The code does not seem to initialize with a default value. https://github.com/OpenCTI-Platform/connectors/blob/master/internal-enrichment/rst-noise-control/src/main.py#L25 Can you test by configuring this variable?

Indeed, adding that variable got it working. Thanks :)

@helene-nguyen helene-nguyen added the solved use to identify issue that has been solved (must be linked to the solving PR) label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug use for describing something not working as expected needs more info Intel needed about the use case solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
Development

No branches or pull requests

3 participants