-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[ASM] EXPANDR-4374 #30601
[ASM] EXPANDR-4374 #30601
Conversation
Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @sapirshuker will know the proposed changes are ready to be reviewed. |
Hi @johnnywilkes, thanks for contributing to a Cortex XSOAR supported pack. To receive credit for your generous contribution please follow this link. |
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.
overall lgtm! some minor comments about organization and docs, and one erroneous test case i think
isArray: true | ||
name: active_classifications | ||
- description: infrastructure hierarchy information to include CSPs. |
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.
i'm not sure i understand what this means, can you elaborate slightly?
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.
if (("env" in key) or (key in ("stage", "function", "lifecycle", "usage", "tier"))) and \ | ||
is_indicator_match(value): | ||
indicators.append(list_entry) | ||
elif comparison_type == "string": |
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.
i might pull this logic out into a separate function to handle list[str]
inputs, while preserving this one for list[dict]
inputs, but that just be a matter of preference since functionally they're equivalent
@@ -217,13 +236,19 @@ def main(): | |||
args = demisto.args() |
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.
can you add the new hierarchy and provider args to the docstring for the main
function? The reference to parameter observed_key_value_pairs
might also need updating
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.
also this might be the more appropriate place to elaborate on what hierarchy_info
is (as opposed to where i commented on the yml)
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.
# Dev Hierachy only | ||
assert final_decision(sample_no_match, sample_no_match, sample_no_match, sample_dev_hierarchy, sample_no_match, "")["result"] | ||
# Both Dev Tags and Hierarchy | ||
assert final_decision(sample_no_match, sample_no_match, sample_no_match, sample_dev_hierarchy, sample_no_match, "")["result"] |
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.
i think this was intended to have sample_dev_tag
as the second arg
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.
fixed in PR feedback
@ShirleyDenkberg , can you please take a look? |
Packs/CortexAttackSurfaceManagement/Scripts/InferWhetherServiceIsDev/README.md
Outdated
Show resolved
Hide resolved
@sapirshuker @kball-pa Doc review completed. |
Co-authored-by: ShirleyDenkberg <[email protected]>
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.
LGTM!
demisto.info(f"Ignoring item because it lacks the keys 'key' and/or 'value': {sorted(kv_pair.keys())}") | ||
for list_entry in observed_list: | ||
if comparison_type == "dictionary": | ||
if not isinstance(list_entry, Mapping): |
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.
if not isinstance(list_entry, Mapping): | |
if not isinstance(list_entry, dict): |
Does this work instead?
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.
from what I have seen, it works exactly the same. I didn't write that line, but can change if you want.
@@ -72,7 +73,7 @@ def test_get_indicators_from_external_classification(classifications, matches): | |||
def test_determine_reason(external, internal, reason): | |||
from InferWhetherServiceIsDev import determine_reason | |||
|
|||
assert determine_reason(external, internal) == reason | |||
assert determine_reason(external, internal, [], "") == reason |
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.
Do we want another test for if provider:
in determine_reason
or is provider not functionally relevant?
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.
I am not doing full testing on determine_reason(). i can, but next person will have to maintain 93%+ unit test coverage
@sapirshuker , please merge when possible |
For the Reviewer: Successfully created a pipeline in Gitlab with url: https://code.pan.run/xsoar/content/-/pipelines/6839323 |
pipeline in Gitlab failed due to a known issue CIAC-6419. |
1a12874
into
demisto:contrib/PaloAltoNetworks_ASM-EXPANDR-4374
* init * lint/format updates * update unit tests * PR feedback * test cov * done for now * docker try1 * Apply suggestions from code review * bump ver --------- Co-authored-by: johnnywilkes <[email protected]> Co-authored-by: ShirleyDenkberg <[email protected]>
* init * lint/format updates * update unit tests * PR feedback * test cov * done for now * docker try1 * Apply suggestions from code review * bump ver --------- Co-authored-by: johnnywilkes <[email protected]> Co-authored-by: ShirleyDenkberg <[email protected]>
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Related Issues
https://jira-dc.paloaltonetworks.com/browse/EXPANDR-4374
Description
Update the dev check automation to reference the GCP Folder hierarchy
Must have