-
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-408
Notion.Many.Pages.Deleted
-> Scheduled Rule (#1423)
Co-authored-by: Ariel Ropek <79653153+arielkr256@users.noreply.github.com> Co-authored-by: Ariel <ariel.ropek@panther.com>
- Loading branch information
1 parent
fe0038e
commit c9724bf
Showing
5 changed files
with
72 additions
and
4 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
29 changes: 29 additions & 0 deletions
29
queries/notion_queries/notion_many_pages_deleted_query.yml
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,29 @@ | ||
AnalysisType: scheduled_query | ||
QueryName: Notion Many Pages Deleted Query | ||
Enabled: false | ||
Tags: | ||
- Notion | ||
- Data Security | ||
- Data Destruction | ||
Description: > | ||
A Notion User deleted multiple pages, which were not created or restored from the trash within the same hour. | ||
Query: | | ||
SELECT | ||
event:actor.person.email AS user | ||
,ARRAY_AGG(event:type) AS actions | ||
,event:details.page_name AS page_name | ||
,event:details.target.page_id AS id | ||
FROM | ||
panther_logs.public.notion_auditlogs | ||
WHERE | ||
p_occurs_since(1 hour) | ||
AND event:type IN ('page.deleted','page.created','page.restored_from_trash') | ||
AND event:details.target.type = 'page_id' | ||
AND page_name != '' | ||
AND event:actor.type = 'person' | ||
GROUP BY id, user, page_name | ||
HAVING | ||
actions = ARRAY_CONSTRUCT('page.deleted') | ||
Schedule: | ||
RateMinutes: 60 | ||
TimeoutMinutes: 2 |
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,7 @@ | ||
def rule(_): | ||
return True | ||
|
||
|
||
def title(event): | ||
user = event.get("user", "<NO_USER_FOUND>") | ||
return f"Notion User [{user}] deleted multiple pages." |
29 changes: 29 additions & 0 deletions
29
queries/notion_queries/notion_many_pages_deleted_sched.yml
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,29 @@ | ||
AnalysisType: scheduled_rule | ||
Filename: notion_many_pages_deleted_sched.py | ||
RuleID: "Notion.Many.Pages.Deleted.Sched" | ||
DisplayName: "Notion Many Pages Deleted" | ||
Enabled: true | ||
ScheduledQueries: | ||
- Notion Many Pages Deleted Query | ||
Tags: | ||
- Notion | ||
- Data Security | ||
- Data Destruction | ||
Severity: Medium | ||
Description: A Notion User deleted multiple pages, which were not created or restored from the trash within the same hour. | ||
DedupPeriodMinutes: 60 | ||
Threshold: 10 # Number of pages deleted; please change this value to suit your organization's needs. | ||
Runbook: Possible Data Destruction. Follow up with the Notion User to determine if this was done for a valid business reason. | ||
Reference: https://www.notion.so/help/duplicate-delete-and-restore-content | ||
Tests: | ||
- Name: query_result | ||
ExpectedResult: true | ||
Log: | ||
{ | ||
"actions": [ | ||
"page.deleted" | ||
], | ||
"id": "1360a5bb-da41-8177-bedb-d015d012392a", | ||
"page_name": "Newslette", | ||
"user": "bob.ross@happytrees.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