Skip to content

Commit 6a9f33e

Browse files
committed
Fix event dict typing
1 parent eeaaaf0 commit 6a9f33e

7 files changed

+11
-11
lines changed

global_helpers/panther_aws_helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def aws_strip_role_session_id(user_identity_arn):
2929
return user_identity_arn
3030

3131

32-
def aws_rule_context(event: dict):
32+
def aws_rule_context(event):
3333
return {
3434
"eventName": event.get("eventName", "<MISSING_EVENT_NAME>"),
3535
"eventSource": event.get("eventSource", "<MISSING_ACCOUNT_ID>"),
@@ -41,7 +41,7 @@ def aws_rule_context(event: dict):
4141
}
4242

4343

44-
def aws_guardduty_context(event: dict):
44+
def aws_guardduty_context(event):
4545
return {
4646
"description": event.get("description", "<MISSING DESCRIPTION>"),
4747
"severity": event.get("severity", "<MISSING SEVERITY>"),

global_helpers/panther_box_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def build_jwt_settings(response: dict) -> dict:
139139

140140
# 'additional_details' from box logs varies by event_type.
141141
# This helper wraps the process of extracting those details.
142-
def box_parse_additional_details(event: dict):
142+
def box_parse_additional_details(event):
143143
additional_details = event.get("additional_details", {})
144144
if isinstance(additional_details, (str, bytes)):
145145
try:

global_helpers/panther_cloudflare_helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def map_source_to_name(event: Any) -> str:
3838
)
3939

4040

41-
def cloudflare_fw_alert_context(event: dict = None):
41+
def cloudflare_fw_alert_context(event=None):
4242
keep_keys = [
4343
"Action",
4444
"ClientIP",
@@ -57,7 +57,7 @@ def cloudflare_fw_alert_context(event: dict = None):
5757
return context_dict
5858

5959

60-
def cloudflare_http_alert_context(event: dict = None):
60+
def cloudflare_http_alert_context(event=None):
6161
keep_keys = [
6262
"BotScore",
6363
"BotScoreSrc",

global_helpers/panther_crowdstrike_fdr_helpers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def crowdstrike_detection_alert_context(event: dict):
1+
def crowdstrike_detection_alert_context(event):
22
"""Returns common context for Crowdstrike detections"""
33
return {
44
"aid": get_crowdstrike_field(event, "aid", default=""),
@@ -13,7 +13,7 @@ def crowdstrike_detection_alert_context(event: dict):
1313
}
1414

1515

16-
def crowdstrike_process_alert_context(event: dict):
16+
def crowdstrike_process_alert_context(event):
1717
"""Returns common process context for Crowdstrike detections"""
1818
return {
1919
"aid": get_crowdstrike_field(event, "aid", default=""),
@@ -28,7 +28,7 @@ def crowdstrike_process_alert_context(event: dict):
2828
}
2929

3030

31-
def crowdstrike_network_detection_alert_context(event: dict):
31+
def crowdstrike_network_detection_alert_context(event):
3232
"""Returns common network context for Crowdstrike detections"""
3333
return {
3434
"LocalAddressIP4": get_crowdstrike_field(event, "LocalAddressIP4", default=""),

global_helpers/panther_duo_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from json import JSONDecodeError
33

44

5-
def deserialize_administrator_log_event_description(event: dict) -> dict:
5+
def deserialize_administrator_log_event_description(event) -> dict:
66
"""Intelligently try and decode a field that is usually stringified json into a python dict.
77
88
This description field seems to take the form of stringified json, So this function

global_helpers/panther_lookuptable_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _lookup(self, match_field: str, *keys) -> list or str:
2727
def p_matched(self):
2828
return self._p_matched
2929

30-
def p_matches(self, event: dict, p_match: str = "") -> dict:
30+
def p_matches(self, event, p_match: str = "") -> dict:
3131
"""Collect enrichments by searching for a value match in the p_match field
3232
3333
Parameters:

global_helpers/panther_okta_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def okta_alert_context(event: dict):
1+
def okta_alert_context(event):
22
"""Returns common context for automation of Okta alerts"""
33
return {
44
"event_type": event.get("eventtype", ""),

0 commit comments

Comments
 (0)