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

Enable passing on auto-run analyzers parameter when using importer library #3143

Merged
merged 29 commits into from
Oct 2, 2024

Conversation

YiChiCanCode
Copy link
Contributor

@YiChiCanCode YiChiCanCode commented Aug 19, 2024

Problem:
According to issue 3096, analyzers cannot be selectively automatically run right after timelines are being uploaded.

New Feature:
Allow users to pass on analyzers and timeline ids to automatically run analyzers on the specified timelines after uploading the timelines with the importer library.

Changes Overview:

  • Add a new function run_analyzers(self, analyzer_names=None), which allows users to run the required analyzers on all the uploaded timelines.
  • add the corresponding flags for timesketch importer tools

For user purpose
To use the updated importer library, one could use the following code

analyzer_names=['sigma', 'feature_extraction'] # or specify the analyzer names you want to use
with importer.ImportStreamer() as stream:
    stream.set_sketch(<sketch_object>)
    stream.set_timeline_name(<timeline_name>)
    stream.add_file(<input_file_object>)
    stream._trigger_analyzers(analyzer_names=analyzer_names) # run analyzers on uploaded timelines

Checks:

  • All tests succeed.
  • Tested code on local development, worked as intended
  • Tested the CLI script

Copy link

google-cla bot commented Aug 19, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jkppr jkppr self-requested a review August 20, 2024 08:46
@jkppr jkppr added Analyzers Data import All things that are with importing data labels Aug 20, 2024
Copy link
Collaborator

@jkppr jkppr left a comment

Choose a reason for hiding this comment

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

Please take a look at the comments below.

importer_client/python/tools/timesketch_importer.py Outdated Show resolved Hide resolved
importer_client/python/tools/timesketch_importer.py Outdated Show resolved Hide resolved
@YiChiCanCode YiChiCanCode requested a review from jkppr August 27, 2024 19:16
Copy link
Collaborator

@jkppr jkppr left a comment

Choose a reason for hiding this comment

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

Please have a look at the comment below.

importer_client/python/tools/timesketch_importer.py Outdated Show resolved Hide resolved
importer_client/python/tools/timesketch_importer.py Outdated Show resolved Hide resolved
importer_client/python/tools/timesketch_importer.py Outdated Show resolved Hide resolved
importer_client/python/tools/timesketch_importer.py Outdated Show resolved Hide resolved
@jkppr jkppr self-requested a review September 13, 2024 12:56
@jkppr jkppr merged commit d34afff into google:master Oct 2, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analyzers Data import All things that are with importing data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants