Skip to content
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

[python3:3.11.10.115186] MyPy In Docker #38026

Merged
merged 8 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions Packs/CommonScripts/ReleaseNotes/1_19_4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#### Scripts

##### LookupCSV

Updated the Docker image to: *demisto/python3:3.11.11.1940698*.

##### CreateHash

Updated the Docker image to: *demisto/python3:3.11.11.1940698*.
2 changes: 1 addition & 1 deletion Packs/CommonScripts/Scripts/CreateHash/CreateHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create_hash(text, hashtype):
h = hashlib.md5() # nosec
h.update(text.encode('utf-8'))
else:
h = blake2b()
h = blake2b() # type: ignore[assignment]
h.update(text.encode('utf-8'))

context = {
Expand Down
4 changes: 2 additions & 2 deletions Packs/CommonScripts/Scripts/CreateHash/CreateHash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ''
dockerimage: demisto/python3:3.11.10.115186
dockerimage: demisto/python3:3.11.11.1940698
enabled: true
name: CreateHash
outputs:
- contextPath: CreateHash
type: string
description: Hash will be stored
description: Hash will be stored.
runas: DBotWeakRole
script: ''
scripttarget: 0
Expand Down
25 changes: 12 additions & 13 deletions Packs/CommonScripts/Scripts/LookupCSV/LookupCSV.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ def search_dicts(k, v, data):
"""
match = []
for row in data:
if k in row:
if v == row[k]:
match.append(row)
if k in row and v == row[k]:
match.append(row)

if len(match) == 1:
# If we only get one result: return just it as a dictr
Expand Down Expand Up @@ -45,17 +44,17 @@ def search_lists(k, v, data):
def main():
d_args = demisto.args()

entry_id = d_args['entryID'] if 'entryID' in d_args else None
header_row = d_args['header_row'] if 'header_row' in d_args else None
search_column = d_args['column'] if 'column' in d_args else None
entry_id = d_args.get('entryID')
header_row = d_args.get('header_row')
search_column = d_args.get('column')

search_value: str = d_args['value'] if 'value' in d_args else None
search_value = d_args.get('value')

add_row = d_args['add_header_row'] if 'add_header_row' in d_args else None
add_row = d_args.get('add_header_row')

res = demisto.getFilePath(entry_id)
if not res:
return_error("Entry {} not found".format(entry_id))
return_error(f"Entry {entry_id} not found")

file_path = res['path']
file_name = res['name']
Expand All @@ -65,7 +64,7 @@ def main():
file_name))

csv_data: list = []
with open(file_path, mode='r') as csv_file:
with open(file_path) as csv_file:
if header_row:
csv_reader = csv.DictReader(csv_file)
for line in csv_reader:
Expand Down Expand Up @@ -97,14 +96,14 @@ def main():
search_column = int(search_column) - 1
except ValueError:
return_error(
"CSV column spec must be integer if header_row not supplied (got {})".format(search_column))
f"CSV column spec must be integer if header_row not supplied (got {search_column})")
csv_data = search_lists(search_column, search_value, csv_data)

output = {
'LookupCSV': {
'FoundResult': True if csv_data and search_column else False,
'FoundResult': bool(csv_data and search_column),
'Result': csv_data if csv_data else None,
'SearchValue': '' if not search_value else search_value
'SearchValue': search_value if search_value else ''
}
}

Expand Down
2 changes: 1 addition & 1 deletion Packs/CommonScripts/Scripts/LookupCSV/LookupCSV.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ outputs:
description: The value that was searched.
scripttarget: 0
subtype: python3
dockerimage: demisto/python3:3.11.10.115186
dockerimage: demisto/python3:3.11.11.1940698
runas: DBotWeakRole
commonfields:
id: LookupCSV
Expand Down
2 changes: 1 addition & 1 deletion Packs/CommonScripts/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Common Scripts",
"description": "Frequently used scripts pack.",
"support": "xsoar",
"currentVersion": "1.19.3",
"currentVersion": "1.19.4",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def remediate_asset_command(client: Client, args: dict) -> CommandResults:
remove_inherited_sharing = argToBoolean(
args.get('remove_inherited_sharing', False)) if remediation_type == 'remove_public_sharing' else None

client.remediate_asset(asset_id, remediation_type, remove_inherited_sharing)
client.remediate_asset(asset_id, remediation_type, remove_inherited_sharing) # type: ignore[arg-type]
outputs = {
'asset_id': asset_id,
'remediation_type': remediation_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ script:
script: '-'
type: python
subtype: python3
dockerimage: demisto/python3:3.11.10.115186
dockerimage: demisto/python3:3.11.11.1940698
defaultmapperin: Saas Security - Incoming Mapper
defaultmapperout: Saas Security - Outgoing Mapper
fromversion: 6.0.0
Expand Down
6 changes: 6 additions & 0 deletions Packs/PrismaSaasSecurity/ReleaseNotes/2_0_35.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### SaaS Security

Updated the Docker image to: *demisto/python3:3.11.11.1940698*.
2 changes: 1 addition & 1 deletion Packs/PrismaSaasSecurity/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "SaaS Security by Palo Alto Networks",
"description": "SaaS Security connects directly to your sanctioned SaaS applications to provide data classification, sharing and permission visibility, and threat detection.",
"support": "xsoar",
"currentVersion": "2.0.34",
"currentVersion": "2.0.35",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def create_context(indicators, include_dbot_score=False, fields_to_return: list
# if there is more than one indicator results - take the one with the highest score
if include_dbot_score:
# see explanation in issue #42224
keys = (value,) if indicator_type != 'file' else filter(None, (md5, sha1, sha256))
keys = (value,) if indicator_type != 'file' else filter(None, (md5, sha1, sha256)) # type: ignore[var-annotated]

old_val = indicators_dbot_score.get(value)
if old_val and old_val['Score'] < dbot_score:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,7 @@ script:
- contextPath: TC.AttributeType.TC.AttributeType.validationRule.version
description: The attribute type validation rule version.
type: string
dockerimage: demisto/python3:3.11.10.116949
dockerimage: demisto/python3:3.11.11.1940698
isfetch: true
script: ''
subtype: python3
Expand Down
6 changes: 6 additions & 0 deletions Packs/ThreatConnect/ReleaseNotes/3_1_11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### ThreatConnect v3

Updated the Docker image to: *demisto/python3:3.11.11.1940698*.
2 changes: 1 addition & 1 deletion Packs/ThreatConnect/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ThreatConnect",
"description": "Threat intelligence platform.",
"support": "xsoar",
"currentVersion": "3.1.10",
"currentVersion": "3.1.11",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Loading