Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ def get_agent():
Auto API expect the agent header to be 'xdr' when running from within XSIAM and 'xsoartim' when running from
within XSOAR (both on-prem and cloud).
"""
# This block is a patch - need to remove it once the server side fix of the following issue is merged:
# https://jira-hq.paloaltonetworks.local/browse/CRTX-77146
if version := get_demisto_version().get('version'):
if version == '8.1.0':
return 'xsoartim'

platform = get_demisto_version().get('platform')
if platform == 'x2':
return 'xsoartim' if is_demisto_version_ge('8.0.0') else 'xdr'
return 'xsoartim'
return 'xdr' if platform == 'x2' else 'xsoartim'

def get_file_report(self, file_hash: str):
return self._http_request(
Expand All @@ -43,7 +47,7 @@ def get_file_report(self, file_hash: str):
''' COMMAND FUNCTIONS '''


def test_module(client: Client) -> str:
def test_module(client: Client) -> str: # pragma: no coverage
try:
wildfire_hash_example = 'dca86121cc7427e375fd24fe5871d727' # guardrails-disable-line
res = client.get_file_report(wildfire_hash_example)
Expand Down Expand Up @@ -94,7 +98,7 @@ def wildfire_get_report_command(client: Client, args: Dict[str, str]):
''' MAIN FUNCTION '''


def main():
def main(): # pragma: no coverage
command = demisto.command()
params = demisto.params()
args = demisto.args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ script:
script: '-'
type: python
subtype: python3
dockerimage: demisto/python3:3.10.9.42476
dockerimage: demisto/python3:3.10.10.48392
fromversion: 6.5.0
tests:
- No tests (auto formatted)
Original file line number Diff line number Diff line change
Expand Up @@ -137,30 +137,27 @@ def test_user_secrets():
assert "%%This_is_API_key%%" not in res


@pytest.mark.parametrize('platform_to_return,version_to_return,expected_agent', [
('xsoar', '6.9.0', 'xsoartim'),
('x2', '8.0.0', 'xsoartim'),
('x2', '6.9.0', 'xdr'),
@pytest.mark.parametrize('platform_to_return,expected_agent', [
('xsoar', 'xsoartim'),
('x2', 'xdr')
])
def test_agent_config(mocker, platform_to_return, version_to_return, expected_agent):
def test_agent_config(mocker, platform_to_return, expected_agent):
"""
Given:
Case 1: Platform type is xsoar (on prem) with version 6.9
Case 1: Platform type is x2 (xsoar cloud/xsiam) with version 8.0
Case 1: Platform type is x2 (xsoar cloud/xsiam) with version 6.9
Case 1: Platform type is xsoar (on prem or cloud)
Case 2: Platform type is x2 (xsiam)

When:
Setting the default 'agent' param for the calls made by the WildFireReports module

Then:
Case 1: Ensure the calls have the 'xsoartim' agent set
Case 1: Ensure the calls have the 'xsoartim' agent set
Case 1: Ensure the calls have the 'xdr' agent set
Case 2: Ensure the calls have the 'xdr' agent set
"""
demisto_version_res = {'platform': platform_to_return, 'version': version_to_return}
demisto_version_res = {'platform': platform_to_return}

# We need to make two mocks since the get_demisto_version is being called twice, once from within WildFireReports
# module anf once from within CommonServerPython
# module and once from within CommonServerPython
mocker.patch('CommonServerPython.get_demisto_version', return_value=demisto_version_res)
mocker.patch('WildFireReports.get_demisto_version', return_value=demisto_version_res)
get_file_call = mocker.patch('CommonServerPython.BaseClient._http_request')
Expand Down
7 changes: 7 additions & 0 deletions Packs/Palo_Alto_Networks_WildFire/ReleaseNotes/2_1_17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#### Integrations

##### Palo Alto Networks WildFire Reports

- Fixed an issue where the integration failed to send the right agent parameter when used by XSIAM users.
- Updated the Docker image to: *demisto/python3:3.10.10.48392*.
2 changes: 1 addition & 1 deletion Packs/Palo_Alto_Networks_WildFire/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "WildFire by Palo Alto Networks",
"description": "Perform malware dynamic analysis",
"support": "xsoar",
"currentVersion": "2.1.16",
"currentVersion": "2.1.17",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down