-
Notifications
You must be signed in to change notification settings - Fork 56
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
[SOAR-18536] palo alto cortex xdr #3027
Conversation
@@ -117,8 +117,7 @@ def get_alerts_palo_alto(self, state: dict, start_time: Optional[int], now: int, | |||
state[CURRENT_COUNT] = state.get(CURRENT_COUNT, 0) + results_count | |||
|
|||
new_alerts, new_alert_hashes, last_alert_time = self._dedupe_and_get_highest_time(results, state) | |||
|
|||
is_paginating = state.get(CURRENT_COUNT) < total_count |
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.
Is the issue here just an off by 1 error or something?
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.
we probbaly never get <
on the finishing statement because on the last page it would equal the total_count. think the comparison was wrong but the new one should still work
@@ -117,8 +117,7 @@ def get_alerts_palo_alto(self, state: dict, start_time: Optional[int], now: int, | |||
state[CURRENT_COUNT] = state.get(CURRENT_COUNT, 0) + results_count | |||
|
|||
new_alerts, new_alert_hashes, last_alert_time = self._dedupe_and_get_highest_time(results, state) | |||
|
|||
is_paginating = state.get(CURRENT_COUNT) < total_count | |||
is_paginating = results_count >= alert_limit |
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.
makes sense to me! can we just log the 'results_count' in the pagination log so we can follow this? I'm guessing our results_count will equal the alert_limit each time? Although reading the logic around alert_limit
it doesn't lok like we ever pass this to the API call against Palo Alto so we may need a follow on ticket, I'm guessing at the minute the default API limit from them is 100.
* Update pagination decision in task * Update unit test pagination * testing unit test * testing unit test * testing unit test * testing unit test * testing unit test * testing unit test * Update logging
Proposed Changes
Description
Describe the proposed changes:
PR Requirements
Developers, verify you have completed the following items by checking them off:
Testing
Unit Tests
Review our documentation on generating and writing plugin unit tests
In-Product Tests
If you are an InsightConnect customer or have access to an InsightConnect instance, the following in-product tests should be done:
Style
Review the style guide
USER nobody
in theDockerfile
when possiblerapid7/insightconnect-python-3-38-slim-plugin:{sdk-version-num}
andrapid7/insightconnect-python-3-38-plugin:{sdk-version-num}
insight-plugin validate
which callsicon_validate
to linthelp.md
Functional Checklist
tests/
directory created withinsight-plugin samples
tests/$action_bad.json
insight-plugin run -T tests/example.json --debug --jq
insight-plugin run -T all --debug --jq
(use PR format at end)insight-plugin run -R tests/example.json --debug --jq
insight-plugin run --debug --jq
(use PR format at end)Assessment
You must validate your work to reviewers:
insight-plugin validate
and make sure everything passesinsight-plugin run -A
. For single action validation:insight-plugin run tests/{file}.json -A
insight-plugin ... | pbcopy
) and paste the output in a new post on this PR