Skip to content

Commit

Permalink
Fix bug ThreatGrid (#21459)
Browse files Browse the repository at this point in the history
  • Loading branch information
israelpoli committed Sep 29, 2022
1 parent bd65dc9 commit 415cbf7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 2 additions & 8 deletions Packs/ThreatGrid/Integrations/ThreatGrid/ThreatGrid.py
Expand Up @@ -244,9 +244,10 @@ def upload_sample():
args[k] = demisto.getArg(k)
args['api_key'] = API_KEY
fileData = demisto.getFilePath(demisto.getArg('file-id'))
filename = demisto.getArg('filename').replace('"', '').replace('\n', '')
with open(fileData['path'], 'rb') as f:
r = requests.request('POST', URL + SUB_API + 'samples',
files={'sample': (encode_sample_file_name(demisto.getArg('filename')), f)},
files={'sample': (filename, f)},
data=args, verify=VALIDATE_CERT)
if r.status_code != requests.codes.ok:
if r.status_code == 503:
Expand All @@ -266,13 +267,6 @@ def upload_sample():
return sample.get('ID')


def encode_sample_file_name(filename):
"""
Encodes sample file name
"""
return filename.encode('ascii', 'ignore').replace('"', '').replace('\n', '')


def get_html_report_by_id():
"""
Download the html report for a sample given the id
Expand Down
4 changes: 4 additions & 0 deletions Packs/ThreatGrid/ReleaseNotes/1_2_16.md
@@ -0,0 +1,4 @@

#### Integrations
##### Cisco Threat Grid
- Fixed an issue in ***threat-grid-upload-sample*** command where filename encoding failed.
2 changes: 1 addition & 1 deletion Packs/ThreatGrid/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Cisco Secure Malware Analytics",
"description": "Query and upload samples to Cisco threat grid.",
"support": "xsoar",
"currentVersion": "1.2.15",
"currentVersion": "1.2.16",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit 415cbf7

Please sign in to comment.