-
Notifications
You must be signed in to change notification settings - Fork 180
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
fix: customer reported that sometimes box_parse_additional_details could raise an error when trying to json.loads #516
Conversation
…uld raise an error when trying to json.loads
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.
based on @lindsey-w's latest internal feedback we should move away from introducing panther-core as a dependency
|
||
## NOTE: WE DO NOT WANT TO IMPORT panther_analysis_tool into any detection | ||
# we need the types from panther_analysis_tool for unit testing sometimes, though | ||
from panther_core.immutable import ImmutableCaseInsensitiveDict, ImmutableList |
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.
based on in internal discussion we want to avoid introducing panther_core as dependency to panther-analysis
…b.com/panther-labs/panther-analysis into fix/edyesed/box_helpers_caseimmutable
@darwayne + @lindsey-w , I believe this is what the internal discussion said we should do |
…b.com/panther-labs/panther-analysis into fix/edyesed/box_helpers_caseimmutable
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 looks right to me, would like to get additional verification from @lindsey-w
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.
Thanks Ed!
@@ -9,6 +9,9 @@ deps: | |||
deps-update: | |||
pipenv update | |||
|
|||
global-helpers-unit-test: | |||
pipenv run python global_helpers/*_test.py |
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.
++
Background
sometimes
event['additional_details']
is typed to not-a-string when processing box events.json.loads()
wanted a string-ish input.Changes
panther_base_helpers.box_parse_additional_details
and provides a feature-equivalent alternative result set, if the TypeError is for one of the panther ImmutableXXX types.Testing
global_helpers/*_test.py
( note: it only works as long as there's a single file matching the pattern ).ATTN: @panther-labs/detections for extra 👀