-
Notifications
You must be signed in to change notification settings - Fork 641
DFIQv2 and Yeti Analyzer Refactor #3501
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
Conversation
* make uuid the new main ID
* Fix a bug in the QuestionListResource.post
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This is a substantial and well-executed pull request that significantly refactors the DFIQ and Yeti analyzer integrations. The move to UUIDs as primary identifiers for DFIQ objects is a great step towards a more robust system. The integration with Yeti for DFIQ templates is a powerful new feature, and the unified loading mechanism is well-designed. The refactoring of the Yeti analyzers to use the official yeti-python library greatly simplifies the code and improves maintainability. The API and database interaction changes, such as using a single transaction for creating scenario objects, are excellent improvements. My only major feedback concerns error handling during the initialization of the Yeti analyzers, where missing configuration could lead to unhandled exceptions.
|
Note: This PR requires https://github.com/yeti-platform/yeti-python to push a new release first to work correctly. |
tomchop
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these changes! First pass on the analyzer, will take a look at the rest soon
|
The failing linter will be fixed once yeti-python 2.0.9 is published. |
This pull request introduces an overhaul of the Digital Forensics Investigative Questions (DFIQ) integration and refactors the Yeti analyzers to use the official
yeti-pythonlibrary.Description
The primary goals of this change are to modernize our DFIQ implementation, improve its flexibility by integrating YETI as a data source, and enhance the robustness of our threat intelligence analyzers.
Key Changes
1. DFIQv2 Implementation (
dfiq.py,scenarios.py)uuidas their primary identifier for lookups, relationships, and sorting. The human-readabledfiq_id(e.g., "S1001") is retained for backwards compatibility in graph building and as a secondary identifier.YETI_DFIQ_ENABLED) controls this behavior.load_dfiq_from_configinscenarios.pyhandles loading from both the local filesystem (DFIQ_PATH) and YETI. It intelligently merges the two sources, with YETI data taking precedence in case of UUID conflicts.dfiq.pyis now built using UUIDs. The in-memory data model (ScenarioTemplate,FacetTemplate, etc.) has been updated to reflect parent-child relationships correctly.POST /api/v1/sketches/<id>/scenarios/now prioritizesuuidfor template lookups, providing a more stable reference thandfiq_idorname.scenarios.yaml,facets.yaml, andquestions.yamlfiles have been removed, along with the old DFIQ YAML files, in favor of the new structured directory format. AREADME.mdis added to guide users.2. Yeti Analyzer Refactor (
yetiindicators.py,yetiindicators_test.py)yeti-pythonLibrary: All Yeti analyzers now use the officialYetiApiclient instead of directrequestscalls.YetiApilibrary now manages authentication and token refreshes transparently.YetiBaseAnalyzer.__init__method now handles authentication. If authentication fails, it raises aRuntimeError, causing the analyzer to fail fast with a clear error message instead of proceeding in an invalid state.api.search_graph,api.search_bloom), making the code cleaner and more maintainable.YetiApiclass and its methods, aligning with the new implementation.