-
Notifications
You must be signed in to change notification settings - Fork 55
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-15940] InsightIDR - advanced_query_on_log_set statistical result bug fix #2108
Conversation
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.
Could you please add schema validation to those tests? 😄
…log_set was always coming back as 0.0
…e schema validation
…e schema validation
21e01e7
to
6af5c5b
Compare
plugins/rapid7_insightidr/help.md
Outdated
@@ -2024,7 +2024,8 @@ Example output: | |||
|
|||
# Version History | |||
|
|||
* 6.0.1 - Action: `Advanced Query On Log Set` - Up the maximium events returned from 50 to 500 | |||
* 6.0.2 - Action: `Advanced Query On Log set` - Fixed error where statistical queries would always return 0.0 | |||
* 6.0.1 - Action: `Advanced Query On Log` - Up the maximium events returned from 50 to 500 |
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 some grammar and spelling check 😄
* 6.0.1 - Action: `Advanced Query On Log` - Up the maximium events returned from 50 to 500 | |
* 6.0.1 - Action: `Advanced Query On Log` - Increase the maximum results returned from 50 to 500 |
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.
this has been updated
stats_response = self.connection.session.get(stats_endpoint, params=params) | ||
try: | ||
stats_response.raise_for_status() | ||
except Exception: |
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.
Exception is very broad here. Maybe narrow it down.
except Exception: | |
except HTTPError as error: |
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.
A more specific exception has been added here
raise PluginException( | ||
cause="Failed to get log sets from InsightIDR\n", | ||
assistance=f"Could not get statistical info from: {stats_endpoint}\n", | ||
data=stats_response.text, |
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.
data=stats_response.text, | |
data=f"{stats_response.text}, {error}, |
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.
The error message will also be raised here
…t bug fix (#2108) * SOAR-15940-Fixing issue where statistical calls to advanced_query_on_log_set was always coming back as 0.0 * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating unit test to reflect change to count * SOAR-15940-adding more specific error handling
…t bug fix (#2108) * SOAR-15940-Fixing issue where statistical calls to advanced_query_on_log_set was always coming back as 0.0 * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating unit test to reflect change to count * SOAR-15940-adding more specific error handling
…t bug fix (#2108) * SOAR-15940-Fixing issue where statistical calls to advanced_query_on_log_set was always coming back as 0.0 * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating unit test to reflect change to count * SOAR-15940-adding more specific error handling
* [SOAR-15940] InsightIDR - advanced_query_on_log_set statistical result bug fix (#2108) * SOAR-15940-Fixing issue where statistical calls to advanced_query_on_log_set was always coming back as 0.0 * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updated unit tests for advanced_query_on_log_set to include schema validation * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating count to better reflect the total items matched * SOAR-15940-updating unit test to reflect change to count * SOAR-15940-adding more specific error handling * [PLGN-614] InsightIDR - Adding parity between advanced_query_on_log_set and advanced_query_on_log (#2110) * PLGN-614-Adding parity between advanced_query_on_log_set and advanced_query_on_log * PLGN-614-Updating the help md to use cpatial letter * PLGN-614-Updating the help md to match style format * [PLGN-651] insightidr - Fixing schema error with required fields and adding in unit tests for checking schemas (#2116) * PLGN-615-Fixing schema error with required fields and adding in unit test coverage for schema * PLGN-615-Updating help doc with new chnages * Bump aiohttp from 3.8.5 to 3.8.6 in /plugins/rapid7_insightidr (#2118) Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.5 to 3.8.6. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](aio-libs/aiohttp@v3.8.5...v3.8.6) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Proposed Changes
Description
Describe the proposed changes:
/query/logs
endpoint, then this ID can be used to the/query/
endpoint to get back the correct values for the statistics, as the will not return the results we needPR 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
new unit test have been added and all of the old tests are passing
In-Product Tests
If you are an InsightConnect customer or have access to an InsightConnect instance, the following in-product tests should be done:
testing via postman using a local docker container and showing the counts line up as expected
cd
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