-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'THREAT-394/snowflake-anomaly-queries' of github.com:pan…
…ther-labs/panther-analysis into THREAT-394/snowflake-anomaly-queries
- Loading branch information
Showing
15 changed files
with
1,482 additions
and
291 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
def zia_success(event): | ||
if ( | ||
event.deep_get("event", "errorcode", default="") == "None" | ||
and event.deep_get("event", "result", default="") == "SUCCESS" | ||
): | ||
return True | ||
return False | ||
|
||
|
||
def zia_alert_context(event): | ||
event_data = event.get("event", {}) | ||
return { | ||
"action": event_data.get("action", ""), | ||
"admin_id": event_data.get("adminid", ""), | ||
"category": event_data.get("category", ""), | ||
"client_ip": event_data.get("clientip", ""), | ||
"preaction": event_data.get("preaction", ""), | ||
"postaction": event_data.get("postaction", ""), | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
AnalysisType: global | ||
Filename: panther_zscaler_helpers.py | ||
GlobalID: "panther_zscaler_helpers" | ||
Description: > | ||
Used to define global helpers for Zscaler events |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
AnalysisType: pack | ||
PackID: PantherManaged.Zscaler.ZIA | ||
Description: Group of all Zscaler ZIA detections | ||
DisplayName: "Panther Zscaler ZIA Pack" | ||
PackDefinition: | ||
IDs: | ||
- ZIA.Account.Access.Removed | ||
- ZIA.Additional.Cloud.Roles | ||
- ZIA.Cloud.Account.Created | ||
- ZIA.Password.Expiration | ||
- ZIA.Trust.Modification | ||
- panther_zscaler_helpers | ||
- panther_base_helpers | ||
|
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from panther_zscaler_helpers import zia_alert_context, zia_success | ||
|
||
SENSITIVE_CATEGORIES = ["ADMINISTRATOR_MANAGEMENT", "ROLE_MANAGEMENT"] | ||
|
||
|
||
def rule(event): | ||
if not zia_success(event): | ||
return False | ||
event_data = event.get("event", {}) | ||
return ( | ||
event_data.get("action", "ACTION_NOT_FOUND") == "DELETE" | ||
and event_data.get("category", "CATEGORY_NOT_FOUND") in SENSITIVE_CATEGORIES | ||
) | ||
|
||
|
||
def title(event): | ||
return ( | ||
f"[Zscaler.ZIA]: Admin account was deleted by admin with id " | ||
f"[{event.deep_get('event', 'adminid', default='<ADMIN_ID_NOT_FOUND>')}]" | ||
) | ||
|
||
|
||
def alert_context(event): | ||
return zia_alert_context(event) |
Oops, something went wrong.