-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THREAT-397 Reformat deep_get(event to event.deep_get(
- Loading branch information
1 parent
7a2bec6
commit 1cbcd51
Showing
260 changed files
with
1,086 additions
and
1,461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from panther_base_helpers import deep_get | ||
|
||
|
||
def auth0_alert_context(event) -> dict: | ||
a_c = {} | ||
a_c["actor"] = deep_get( | ||
event, "data", "details", "request", "auth", "user", default="<NO_ACTOR_FOUND>" | ||
a_c["actor"] = event.deep_get( | ||
"data", "details", "request", "auth", "user", default="<NO_ACTOR_FOUND>" | ||
) | ||
a_c["action"] = deep_get(event, "data", "description", default="<NO_ACTION_FOUND>") | ||
a_c["action"] = event.deep_get("data", "description", default="<NO_ACTION_FOUND>") | ||
return a_c | ||
|
||
|
||
def is_auth0_config_event(event): | ||
channel = deep_get(event, "data", "details", "request", "channel", default="") | ||
channel = event.deep_get("data", "details", "request", "channel", default="") | ||
return channel == "https://manage.auth0.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
from panther_base_helpers import deep_get | ||
|
||
|
||
def actor_user(event): | ||
category = deep_get(event, "category", default="") | ||
category = event.deep_get("category", default="") | ||
if category in {"ServicePrincipalSignInLogs"}: | ||
return deep_get(event, "properties", "servicePrincipalName") | ||
return event.deep_get("properties", "servicePrincipalName") | ||
if category in {"SignInLogs", "NonInteractiveUserSignInLogs"}: | ||
return deep_get(event, "properties", "userPrincipalName") | ||
return event.deep_get("properties", "userPrincipalName") | ||
return None | ||
|
||
|
||
def is_sign_in_event(event): | ||
return deep_get(event, "operationName", default="") == "Sign-in activity" | ||
return event.deep_get("operationName", default="") == "Sign-in activity" | ||
|
||
|
||
def azure_signin_alert_context(event) -> dict: | ||
ac_actor_user = actor_user(event) | ||
if ac_actor_user is None: | ||
ac_actor_user = "<NO_ACTORUSER>" | ||
a_c = {} | ||
a_c["tenantId"] = deep_get(event, "tenantId", default="<NO_TENANTID>") | ||
a_c["source_ip"] = deep_get(event, "properties", "ipAddress", default="<NO_SOURCEIP>") | ||
a_c["tenantId"] = event.deep_get("tenantId", default="<NO_TENANTID>") | ||
a_c["source_ip"] = event.deep_get("properties", "ipAddress", default="<NO_SOURCEIP>") | ||
a_c["actor_user"] = ac_actor_user | ||
a_c["resourceDisplayName"] = deep_get( | ||
event, "properties", "resourceDisplayName", default="<NO_RESOURCEDISPLAYNAME>" | ||
a_c["resourceDisplayName"] = event.deep_get( | ||
"properties", "resourceDisplayName", default="<NO_RESOURCEDISPLAYNAME>" | ||
) | ||
a_c["resourceId"] = deep_get(event, "properties", "resourceId", default="<NO_RESOURCEID>") | ||
a_c["resourceId"] = event.deep_get("properties", "resourceId", default="<NO_RESOURCEID>") | ||
return a_c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.