-
Notifications
You must be signed in to change notification settings - Fork 32
Pex 552/on demand detection triggers #416
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
base: main
Are you sure you want to change the base?
Conversation
time_to_execute = 0 | ||
|
||
# Check if the job is finished | ||
while not job.is_done(): |
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.
dispatch()
appears to take a **kwargs argument. Instead of using the while
loop, can we just pass a {'exec_mode': 'blocking'}
as we do for unit testing?
job = self.service.search(query, exec_mode="blocking") # type: ignore |
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.
Just check the description of the parameter (If set to blocking, returns the sid when the job is complete.), exec_mode sounds to be a better way than while loop! Would change it and test with pipeline later.
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.
It seems like the exec_mode
is not supported in the dispatch() function. This is what I got when trying to pass exec_mode
argument when testing locally:
2025-06-18 14:19:05,932 - ERROR:contentctl.objects.correlation_search - TEST FAILED (ERROR): Exception raised during integration test: HTTP error encountered while dispatching detection: HTTP 400 Bad Request -- Argument "exec_mode" is not supported by this handler.
For integration testing, instead of scheduling a savedsearch to run and waiting a predefined amount of time, use the API to call the search right away. This can be a significant improvement in terms of the amount of time spent waiting for RBA/Notable artifacts to be generated.