-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into gcp-pack-refresh
- Loading branch information
Showing
23 changed files
with
370 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import panther_event_type_helpers as event_type | ||
|
||
ADMIN_EVENTS = { | ||
"business.add_admin", | ||
"business.invite_admin", | ||
"team.promote_maintainer", | ||
} | ||
|
||
def get_admin_role(_): | ||
# github doesn't record the admin role in the event | ||
return "<UNKNOWN_ROLE>" | ||
|
||
def get_admin_role(event): | ||
action = event.get("action", "") | ||
return action if action in ADMIN_EVENTS else "<UNKNOWN_ADMIN_ROLE>" | ||
|
||
|
||
def get_event_type(event): | ||
if event.get("action") == "team.promote_maintainer": | ||
if event.get("action", "") in ADMIN_EVENTS: | ||
return event_type.ADMIN_ROLE_ASSIGNED | ||
if event.get("action") == "org.disable_two_factor_requirement": | ||
if event.get("action", "") == "org.disable_two_factor_requirement": | ||
return event_type.MFA_DISABLED | ||
return None |
Oops, something went wrong.