Skip to content

Commit

Permalink
[VirusTotal] Fix error when optional parameter extended_data is not p…
Browse files Browse the repository at this point in the history
…resent in command calls (#27414)

* [VirusTotal] Fix error when optional parameter extended_data is not present in command calls (#27411)

* Fix error when optional parameter extended_data is not present in command calls

* release notes

* docker image update

* updated rn

---------

Co-authored-by: Daniel Pascual <[email protected]>
Co-authored-by: michal-dagan <[email protected]>
  • Loading branch information
3 people authored and ostolero committed Jun 14, 2023
1 parent 30a14b5 commit 20ee604
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Packs/VirusTotal/Integrations/VirusTotalV3/VirusTotalV3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ def ip_command(client: Client, score_calculator: ScoreCalculator, args: dict, re
continue
execution_metrics.success += 1
results.append(
build_ip_output(client, score_calculator, ip, raw_response, argToBoolean(args.get('extended_data'))))
build_ip_output(client, score_calculator, ip, raw_response, argToBoolean(args.get('extended_data', False))))
if len(results) == 0:
result = CommandResults(readable_output='No IPs were found.').to_context()
results.append(result)
Expand All @@ -1713,7 +1713,7 @@ def file_command(client: Client, score_calculator: ScoreCalculator, args: dict,
1 API Call
"""
files = argToList(args['file'])
extended_data = argToBoolean(args.get('extended_data'))
extended_data = argToBoolean(args.get('extended_data', False))
results: List[CommandResults] = list()
execution_metrics = ExecutionMetrics()

Expand Down Expand Up @@ -1789,7 +1789,7 @@ def url_command(client: Client, score_calculator: ScoreCalculator, args: dict, r
1-4 API Calls for premium subscriptions
"""
urls = argToList(args['url'])
extended_data = argToBoolean(args.get('extended_data'))
extended_data = argToBoolean(args.get('extended_data', False))
results: List[CommandResults] = list()
execution_metrics = ExecutionMetrics()
for url in urls:
Expand Down Expand Up @@ -1840,7 +1840,7 @@ def domain_command(client: Client, score_calculator: ScoreCalculator, args: dict
continue
execution_metrics.success += 1
result = build_domain_output(client, score_calculator, domain, raw_response,
argToBoolean(args.get('extended_data')))
argToBoolean(args.get('extended_data', False)))
results.append(result)
if len(results) == 0:
result = CommandResults(readable_output='No domains were found.')
Expand Down Expand Up @@ -2302,7 +2302,7 @@ def search_command(client: Client, args: dict) -> CommandResults:
limit = arg_to_number_must_int(args.get('limit'), 'limit', required=True)
raw_response = client.search(query, limit)
data = raw_response.get('data', [])
if not argToBoolean(args.get('extended_data')):
if not argToBoolean(args.get('extended_data', False)):
data = decrease_data_size(data)
return CommandResults(
f'{INTEGRATION_ENTRY_CONTEXT}.SearchResults',
Expand Down
7 changes: 6 additions & 1 deletion Packs/VirusTotal/Integrations/VirusTotalV3/VirusTotalV3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ script:
description: Hash of the file to query. Supports MD5, SHA1, and SHA256.
isArray: true
- name: extended_data
defaultValue: 'false'
required: false
description: Whether to return extended data (last_analysis_results).
isArray: false
Expand Down Expand Up @@ -422,6 +423,7 @@ script:
description: IP address to check.
isArray: true
- name: extended_data
defaultValue: 'false'
required: false
description: Whether to return extended data (last_analysis_results).
isArray: false
Expand Down Expand Up @@ -538,6 +540,7 @@ script:
description: URL to check.
isArray: true
- name: extended_data
defaultValue: 'false'
required: false
description: Whether to return extended data (last_analysis_results).
isArray: false
Expand Down Expand Up @@ -680,6 +683,7 @@ script:
description: Domain name to check.
isArray: true
- name: extended_data
defaultValue: 'false'
required: false
description: Whether to return extended data (last_analysis_results).
isArray: false
Expand Down Expand Up @@ -1031,6 +1035,7 @@ script:
default: true
description: 'This endpoint searches any of the following: A file hash, URL, domain, IP address, tag comments.'
- name: extended_data
defaultValue: 'false'
required: false
description: Whether to return extended data (last_analysis_results).
isArray: false
Expand Down Expand Up @@ -1639,7 +1644,7 @@ script:
type: String

runonce: false
dockerimage: demisto/python3:3.10.11.56082
dockerimage: demisto/python3:3.10.12.62631
tests:
- VirusTotalV3-test
- VirusTotal (API v3) Detonate Test
4 changes: 4 additions & 0 deletions Packs/VirusTotal/ReleaseNotes/2_6_3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#### Integrations
##### VirusTotal (API v3)
- Fixed an issue where **extended_data** argument wasn't parsed correctly in cases it wasn't specified.
- Updated the Docker image to: *demisto/python3:3.10.12.62631*.
4 changes: 2 additions & 2 deletions Packs/VirusTotal/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "VirusTotal",
"description": "Analyze suspicious hashes, URLs, domains and IP addresses",
"support": "partner",
"currentVersion": "2.6.2",
"currentVersion": "2.6.3",
"author": "VirusTotal",
"url": "https://www.virustotal.com",
"email": "[email protected]",
Expand All @@ -18,4 +18,4 @@
"xsoar",
"marketplacev2"
]
}
}

0 comments on commit 20ee604

Please sign in to comment.