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

Refactor panther_azuresignin_helpers.actor_user to use imported deep_get #1422

Merged
Merged
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions global_helpers/panther_azuresignin_helpers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from panther_base_helpers import deep_get


def actor_user(event):
# 'event' could be a PantherEvent or an ImmutableCaseInsensitiveDict, so we have to use the
# imported deep_get method.
category = event.get("category", "")
if category in {"ServicePrincipalSignInLogs"}:
return event.deep_get("properties", "servicePrincipalName")
return deep_get(event, "properties", "servicePrincipalName")
if category in {"SignInLogs", "NonInteractiveUserSignInLogs"}:
return event.deep_get("properties", "userPrincipalName")
return deep_get(event, "properties", "userPrincipalName")
return None


Expand Down
Loading