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

[Bambenek] create bambenek connector #3280

Conversation

larryfinch
Copy link
Contributor

@larryfinch larryfinch commented Jan 15, 2025

Proposed changes

  • Adding in Bambenek connector code

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

I've tested that all the individual components work as expected. Testing everything as a whole was not feasible due to my organization using private certs as the requests library just returns certificate errors. I did confirm that it loads configs and initializes as expected when run with docker compose

Please let me know if there's any questions or issues

@romain-filigran romain-filigran linked an issue Jan 15, 2025 that may be closed by this pull request
@romain-filigran romain-filigran added this to the PRs backlog milestone Jan 15, 2025
@romain-filigran romain-filigran added community use to identify PR from community feature use for describing a new feature to develop labels Jan 15, 2025
@richard-julien richard-julien force-pushed the master branch 2 times, most recently from 9818df2 to 0f4b30d Compare February 4, 2025 14:35
@helene-nguyen helene-nguyen changed the title Feature/create bambenek connector [Bambenek] create bambenek connector Feb 12, 2025
@flavienSindou flavienSindou self-requested a review February 12, 2025 10:24
Copy link
Contributor

@flavienSindou flavienSindou left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution.
The code is clear and appears to be mostly robust.

I'd like you to correct the default values for config_variables and update the documentation slightly. Otherwise, I've made some minor suggestions for code improvements that are not mandatory but could make your connector more robust.

I’m unable to test the full functionality of your connector end-to-end since I don’t have the necessary credential

I'll be happy to merge your work once you've updated the code.

Feel free to reach out if you have any questions or comments.

Comment on lines 34 to 40
# validate collection configured
for collection in self.config.bambenek_collections:
if collection not in SUPPORTED_COLLECTIONS:
self.helper.connector_logger.error(
f"Unsupported configured: {collection}"
)
self.config.bambenek_collections.remove(collection)
Copy link
Contributor

@flavienSindou flavienSindou Feb 12, 2025

Choose a reason for hiding this comment

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

[TIP]
This check could be done in config_variables.py to clearly separate module scopes and responsibilities

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've moved this functionality over

self.helper.connector_logger.info(
"[CONNECTOR] Connector has never run..."
)
last_run = None
Copy link
Contributor

Choose a reason for hiding this comment

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

[CLEANING]
last_run var does not seem to be used

@SamuelHassine SamuelHassine force-pushed the master branch 2 times, most recently from b513b96 to 11a05bf Compare February 14, 2025 12:49
@larryfinch
Copy link
Contributor Author

@flavienSindou the formatting check is failing on an unrelated file 'external-import/crowdstrike/src/crowdstrike_feeds_connector/indicator/builder.py'
I've ran the command from circleci on that file and the check comes back clear. Not sure if this is due to different isort versions

Copy link
Contributor

@flavienSindou flavienSindou left a comment

Choose a reason for hiding this comment

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

Thanks for all the changes you made, @larryfinch !

To resolve the issue with the CrowdStrike file, you'll need to rebase your branch with the latest changes from the master branch.

We recently updated the isort and black requirements, which led to some refactoring between the time you started your branch and now (see issue #3338 for details).

Once that's done, I'll be happy to merge your PR and include your new connector in our codebase.

@larryfinch
Copy link
Contributor Author

@flavienSindou I pulled in the updates and everything is passing!

@flavienSindou flavienSindou self-requested a review February 26, 2025 14:05
@flavienSindou flavienSindou merged commit 881e881 into OpenCTI-Platform:master Feb 26, 2025
4 checks passed
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 feature use for describing a new feature to develop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bambenek]: Create a connector for "Bambenek Consulting Feed"
3 participants