-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathsnowflake_0108977_configuration_drift_query.yml
54 lines (52 loc) · 1.91 KB
/
snowflake_0108977_configuration_drift_query.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
AnalysisType: scheduled_query
Enabled: false
QueryName: "Query.Snowflake.ConfigurationDrift"
Description: >
Monitor for configuration drift made by malicious actors as part of ongoing cyber threat activity reported May 31st, 2024
Tags:
- Configuration Required
Query: |
-- https://community.snowflake.com/s/article/Communication-ID-0108977-Additional-Information
-- adjust query/limit to narrow as necessary
SELECT
query_text,
user_name,
role_name,
start_time as p_event_time,
end_time
FROM snowflake.account_usage.query_history
WHERE ((execution_status = 'SUCCESS'
AND query_type NOT in ('SELECT')
AND user_name NOT in ('PANTHER_ADMIN', 'PANTHERACCOUNTADMIN')
AND (query_text ILIKE '%create role%'
OR query_text ILIKE '%manage grants%'
OR query_text ILIKE '%create integration%'
OR query_text ILIKE '%alter integration%'
OR query_text ILIKE '%create share%'
OR query_text ILIKE '%create account%'
OR query_text ILIKE '%monitor usage%'
OR query_text ILIKE '%ownership%'
OR query_text ILIKE '%drop table%'
OR query_text ILIKE '%drop database%'
OR query_text ILIKE '%create stage%'
OR query_text ILIKE '%drop stage%'
OR query_text ILIKE '%alter stage%'
OR query_text ILIKE '%create user%'
OR query_text ILIKE '%alter user%'
OR query_text ILIKE '%drop user%'
OR query_text ILIKE '%create_network_policy%'
OR query_text ILIKE '%alter_network_policy%'
OR query_text ILIKE '%drop_network_policy%'
OR query_text ILIKE '%copy%'
)
) OR (
query_text ilike '%grant%accountadmin%to%'
AND query_type = 'GRANT'
AND execution_status = 'SUCCESS'
))
AND p_occurs_since('1 day')
ORDER BY end_time desc
LIMIT 100;
Schedule:
RateMinutes: 1440
TimeoutMinutes: 3