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

Improve ransomware.live connector #2746

Merged
merged 6 commits into from
Jan 10, 2025

Conversation

seanthegeek
Copy link
Contributor

@seanthegeek seanthegeek commented Oct 1, 2024

Proposed changes

  • Properly handle empty sector values
  • Do not create threat actor objects by default
    • They were wasteful duplicates of Intrusion Sets and not threat actors in terms of STIX definitions
  • Fix typos
  • Fix README tables

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@seanthegeek
Copy link
Contributor Author

How do I properly test this connector on my development system? This PR should work, but I'm keeping the PR in draft status until I can properly test it.

{"timestamp": "2024-10-01T23:54:16.228980Z", "level": "ERROR", "name": "pika.adapters.utils.connection_workflow", "message": "AMQP connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(11001, 'getaddrinfo failed'); first exception - None.", "taskName": null}
{"timestamp": "2024-10-01T23:54:16.228980Z", "level": "ERROR", "name": "pika.adapters.utils.connection_workflow", "message": "AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(11001, 'getaddrinfo failed'); first exception - None", "taskName": null}
{"timestamp": "2024-10-01T23:54:16.228980Z", "level": "ERROR", "name": "pika.adapters.blocking_connection", "message": "Connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(11001, 'getaddrinfo failed'); first exception - None", "taskName": null}

@seanthegeek
Copy link
Contributor Author

I was able to test is by creating a local docker image, but that's not ideal if I want to walk through the Python code in a debugger

Now I'm getting an exception that states "File data is not a valid bundle"

{"timestamp": "2024-10-02T00:30:20.182278Z", "level": "ERROR", "name": "ransomware.live", "message": "Error sending STIX2 bundle to OpenCTI", "exc_info": "Traceback (most recent call last):\n  File \"/opt/connector/lib/ransomConn.py\", line 960, in run\n    self.helper.send_stix2_bundle(\n  File \"/usr/local/lib/python3.11/site-packages/pycti/connector/opencti_connector_helper.py\", line 1699, in send_stix2_bundle\n    ) = stix2_splitter.split_bundle_with_expectations(\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/pycti/utils/opencti_stix2_splitter.py\", line 215, in split_bundle_with_expectations\n    raise Exception(\"File data is not a valid bundle\")\nException: File data is not a valid bundle"}

Any suggestions for tracking down where my PR went wrong?

@seanthegeek seanthegeek marked this pull request as ready for review October 2, 2024 02:53
@seanthegeek
Copy link
Contributor Author

All issues have been fixed.

@yassine-ouaamou yassine-ouaamou added the community use to identify PR from community label Oct 3, 2024
Copy link
Member

@Powlinett Powlinett left a comment

Choose a reason for hiding this comment

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

Hi @seanthegeek thank you for submitting a PR and improvements!

I managed to resolve conflicts locally by keeping your changes and pycti.<ENTITY_CLASS>.generate_id() functions calls from master.🤞

I had to add "filterGroups": [] on line ~320 (in filterGroups[0]) to avoid errors returned by OpenCTI API, and now everything seems to work as intended 👍

May I ask you to resolve conflicts and fix the filters tiny issue on your repo so we can merge your PR? Thanks 🙏

@seanthegeek
Copy link
Contributor Author

Hi. Sorry I missed this message two months ago! Maintainers like you have the ability to modify my incoming branch. That's the best way, since you know exactly what needs to be done.

seanthegeek and others added 6 commits January 9, 2025 18:00
- Properly handle empty sector values
- Do not create threat actor objects by default
  - They were wasteful duplicates of Intrusion Sets and not threat actors in terms of STIX
- Fix typos
- Fix README tables
@Powlinett Powlinett force-pushed the ransomwarelive-fixes branch from f2b929a to 968c5fa Compare January 9, 2025 18:17
@Powlinett Powlinett linked an issue Jan 9, 2025 that may be closed by this pull request
Copy link
Member

@Powlinett Powlinett left a comment

Choose a reason for hiding this comment

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

Conflicts resolved ✅

@Powlinett Powlinett merged commit 714b94d into OpenCTI-Platform:master Jan 10, 2025
4 checks passed
@helene-nguyen helene-nguyen added the solved use to identify issue that has been solved (must be linked to the solving PR) label Jan 13, 2025
@helene-nguyen helene-nguyen added this to the Release 6.4.7 milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community use to identify PR from community improvement solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ransomware.live] improvements
5 participants