Skip to content

Commit

Permalink
A small fix in CSP, FireEye, O365 for supporting python 3.12 (#38051)
Browse files Browse the repository at this point in the history
* make the docstring a raw str

* RN

* add some more fixes

* rn

* rn

---------

Co-authored-by: RotemAmit <ramit@paloaltonetworks.com>
  • Loading branch information
rshunim and RotemAmit authored Jan 14, 2025
1 parent e8fca30 commit fd340a0
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Packs/Base/ReleaseNotes/1_39_14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### Scripts

##### CommonServerPython

- Improved implementation.
4 changes: 2 additions & 2 deletions Packs/Base/Scripts/CommonServerPython/CommonServerPython.py
Original file line number Diff line number Diff line change
Expand Up @@ -6793,7 +6793,7 @@ def arg_to_datetime(arg, arg_name=None, is_utc=True, required=False, settings=No
ms = ms / 1000.0

if is_utc:
return datetime.utcfromtimestamp(ms).replace(tzinfo=timezone.utc)
return datetime.fromtimestamp(ms, tz=timezone.utc)
else:
return datetime.fromtimestamp(ms)
if isinstance(arg, str):
Expand Down Expand Up @@ -12650,7 +12650,7 @@ def function_runner(func, profiler, signal_event,


def find_and_remove_sensitive_text(text, pattern):
"""
r"""
Finds all appearances of sensitive information in a string using regex and adds the sensitive
information to the list of strings that should not appear in any logs.
The regex pattern can be used to search for a specific word, or a pattern such as a word after a given word.
Expand Down
2 changes: 1 addition & 1 deletion Packs/Base/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Base",
"description": "The base pack for Cortex XSOAR.",
"support": "xsoar",
"currentVersion": "1.39.13",
"currentVersion": "1.39.14",
"author": "Cortex XSOAR",
"serverMinVersion": "6.0.0",
"url": "https://www.paloaltonetworks.com/cortex",
Expand Down
4 changes: 2 additions & 2 deletions Packs/FireEyeHX/Integrations/FireEyeHXv2/FireEyeHXv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ def parse_alert_to_incident(alert: Dict, pattern: Pattern) -> Dict:
indicator = event_values.get(event_indicator, '')

incident_name = '{event_type_parsed}: {indicator}'.format(
event_type_parsed=pattern.sub("\g<1> \g<2>", event_type).title(),
event_type_parsed=pattern.sub(r"\g<1> \g<2>", event_type).title(),
indicator=indicator
)

Expand Down Expand Up @@ -2580,7 +2580,7 @@ def get_alert_command(client: Client, args: Dict[str, Any]) -> List[CommandResul

event_type = alert.get('event_type')
event_type = event_type if event_type else "NewEvent"
event_type = re.sub("([a-z])([A-Z])", "\g<1> \g<2>", event_type).title()
event_type = re.sub("([a-z])([A-Z])", r"\g<1> \g<2>", event_type).title()
event_table = tableToMarkdown(
name=event_type,
t=alert.get('event_values')
Expand Down
5 changes: 5 additions & 0 deletions Packs/FireEyeHX/ReleaseNotes/2_3_18.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### Integrations

##### FireEye Endpoint Security (HX) v2

Improved implementation.
2 changes: 1 addition & 1 deletion Packs/FireEyeHX/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "FireEye HX",
"description": "FireEye Endpoint Security is an integrated solution that detects and protects endpoints against known and unknown threats. The FireEye HX Cortex XSOAR integration provides access to information about endpoints, acquisitions, alerts, indicators, and containment. Customers can extract critical data and effectively operate the security operations automated playbooks.",
"support": "xsoar",
"currentVersion": "2.3.17",
"currentVersion": "2.3.18",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,7 @@ def handle_incorrect_message_id(message_id: str) -> str:
2. '\r\n\t<[message_id]>' --> '\r\n\t<message_id>'
If no necessary changes identified the original 'message_id' argument value is returned.
"""
if re.search("\<\[.*\]\>", message_id):
if re.search(r"\<\[.*\]\>", message_id):
# find and replace "<[" with "<" and "]>" with ">"
fixed_message_id = re.sub(r'<\[(.*?)\]>', r'<\1>', message_id)
demisto.debug('Fixed message id {message_id} to {fixed_message_id}')
Expand Down
5 changes: 5 additions & 0 deletions Packs/MicrosoftExchangeOnline/ReleaseNotes/1_5_25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### Integrations

##### EWS O365

Improved implementation.
2 changes: 1 addition & 1 deletion Packs/MicrosoftExchangeOnline/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Microsoft Exchange Online",
"description": "Exchange Online and Office 365 (mail)",
"support": "xsoar",
"currentVersion": "1.5.24",
"currentVersion": "1.5.25",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit fd340a0

Please sign in to comment.