Fix SecOps rule detection arguments - #283
Conversation
|
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. |
|
Friendly ping on this one. CI is green and it still merges cleanly. Happy to rebase, split it up, or add more test coverage if any of that would help. Is there anything else I can do to move it along? |
|
Thank you for your contribution, @abdeltaehass! I'll try to review ASAP. |
| start_dt = ( | ||
| datetime.fromisoformat(start_time.replace("Z", "+00:00")) | ||
| if start_time | ||
| else None | ||
| ) | ||
| end_dt = ( | ||
| datetime.fromisoformat(end_time.replace("Z", "+00:00")) | ||
| if end_time | ||
| else None | ||
| ) |
There was a problem hiding this comment.
I know you are following precedent in this project, so there is no blame, but this has some issues, which I've described in #291. I think I will fast follow with a fix of all occurrences of this rather than block your PR.
Summary
ChronicleClient.list_detectionsfilters and pagination arguments by keywordstart_time,end_time, andlist_basisparameters throughget_rule_detectionsRoot cause
get_rule_detectionspassedalert_state,page_size, andpage_tokenpositionally. The Chronicle SDK placesstart_time,end_time, andlist_basisbefore those parameters, so values such as"ALERTING"were bound tostart_timeand failed when the SDK calledstrftime().The wrapper now uses explicit keyword arguments and converts optional ISO-8601 time strings to
datetimeobjects before calling the SDK.Fixes #263
Validation
get_rule_detectionstests: 2 passedgit diff --check: passed