Skip to content

Commit 7096864

Browse files
authored
Merge pull request #9 from turbot/release/v0.4.0
Release/v0.4.0
2 parents 28f10e8 + 6f3a1d3 commit 7096864

18 files changed

+262
-51
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## v0.3.0 [2025-03-03]
2+
3+
_Enhancements_
4+
5+
- Added `title`, `description`, and `folder = "Project"` tag to `Activity Dashboard` queries for improved organization and clarity. ([#7](https://github.com/turbot/tailpipe-mod-gcp-audit-log-detections/pull/7))
6+
- Added `folder = "<service>"` tag to `service common tag locals` for better query categorization. ([#7](https://github.com/turbot/tailpipe-mod-gcp-audit-log-detections/pull/7))
7+
- Standardized all queries to use `service common tags`, ensuring consistency across detection queries. ([#7](https://github.com/turbot/tailpipe-mod-gcp-audit-log-detections/pull/7))
8+
19
## v0.3.0 [2025-02-14]
210

311
_Enhancements_

dashboards/activity_dashboard.pp

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,24 @@
6868
# -----------------------------
6969

7070
query "activity_dashboard_total_logs" {
71-
title = "Log Count"
71+
title = "Log Count"
72+
description = "Count the total log entries."
7273

7374
sql = <<-EOQ
7475
select
7576
count(*) as "Total Logs"
7677
from
7778
gcp_audit_log;
7879
EOQ
80+
81+
tags = {
82+
folder = "Project"
83+
}
7984
}
8085

8186
query "activity_dashboard_logs_by_project" {
82-
title = "Logs by Project"
87+
title = "Logs by Project"
88+
description = "Count the total log entries grouped by project."
8389

8490
sql = <<-EOQ
8591
select
@@ -95,29 +101,39 @@
95101
count(*) desc
96102
limit 10;
97103
EOQ
104+
105+
tags = {
106+
folder = "Project"
107+
}
98108
}
99109

100110
query "activity_dashboard_logs_by_type" {
101-
title = "Logs by Type"
111+
title = "Logs by Type"
112+
description = "Count the total log entries grouped by type."
102113

103114
sql = <<-EOQ
104115
select
105-
split_part(log_name, '%2F', 2) as "Type",
116+
split_part(replace(log_name, '%2F', '/'),'/', 5) as "Type",
106117
count(*) as "Logs"
107118
from
108119
gcp_audit_log
109120
where
110-
split_part(log_name, '%2F', 2) is not null
121+
split_part(replace(log_name, '%2F', '/'),'/', 5) is not null
111122
group by
112-
split_part(log_name, '%2F', 2)
123+
split_part(replace(log_name, '%2F', '/'),'/', 5)
113124
order by
114125
count(*) desc
115126
limit 10;
116127
EOQ
128+
129+
tags = {
130+
folder = "Project"
131+
}
117132
}
118133

119134
query "activity_dashboard_logs_by_service" {
120-
title = "Logs by Service"
135+
title = "Top 10 Services"
136+
description = "List the top 10 services by frequency."
121137

122138
sql = <<-EOQ
123139
select
@@ -133,10 +149,15 @@
133149
count(*) desc
134150
limit 10;
135151
EOQ
152+
153+
tags = {
154+
folder = "Project"
155+
}
136156
}
137157

138158
query "activity_dashboard_logs_by_event" {
139-
title = "Top 10 Events"
159+
title = "Top 10 Events"
160+
description = "List the 10 most frequently called events."
140161

141162
sql = <<-EOQ
142163
select
@@ -152,10 +173,15 @@
152173
count(*) desc
153174
limit 10;
154175
EOQ
176+
177+
tags = {
178+
folder = "Project"
179+
}
155180
}
156181

157182
query "activity_dashboard_logs_by_actor" {
158-
title = "Top 10 Actors"
183+
title = "Top 10 Actors"
184+
description = "List the 10 most active actors."
159185

160186
sql = <<-EOQ
161187
select
@@ -171,10 +197,15 @@
171197
count(*) desc
172198
limit 10;
173199
EOQ
200+
201+
tags = {
202+
folder = "Project"
203+
}
174204
}
175205

176206
query "activity_dashboard_logs_by_source_ip" {
177-
title = "Top 10 Source IPs"
207+
title = "Top 10 Source IPs (Excluding GCP Internal)"
208+
description = "List the 10 most active source IPs, excluding events from GCP internal."
178209

179210
sql = <<-EOQ
180211
select
@@ -191,4 +222,8 @@
191222
count(*) desc
192223
limit 10;
193224
EOQ
225+
226+
tags = {
227+
folder = "Project"
228+
}
194229
}

detections/access_context_manager.pp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
access_context_manager_common_tags = merge(local.gcp_audit_log_detections_common_tags, {
3+
folder = "Access Context Manager"
34
service = "GCP/AccessContextManager"
45
})
56

@@ -27,7 +28,9 @@
2728
query = query.access_context_manager_policy_deleted
2829
display_columns = local.detection_display_columns
2930

30-
tags = local.access_context_manager_common_tags
31+
tags = merge(local.access_context_manager_common_tags, {
32+
mitre_attack_ids = "TA0005:T1578.005"
33+
})
3134
}
3235

3336
detection "access_context_manager_access_level_deleted" {
@@ -38,7 +41,9 @@
3841
query = query.access_context_manager_access_level_deleted
3942
display_columns = local.detection_display_columns
4043

41-
tags = local.access_context_manager_common_tags
44+
tags = merge(local.access_context_manager_common_tags, {
45+
mitre_attack_ids = "TA0005:T1578.005"
46+
})
4247
}
4348

4449
query "access_context_manager_policy_deleted" {
@@ -53,6 +58,8 @@
5358
order by
5459
timestamp desc;
5560
EOQ
61+
62+
tags = local.access_context_manager_common_tags
5663
}
5764

5865
query "access_context_manager_access_level_deleted" {
@@ -67,4 +74,6 @@
6774
order by
6875
timestamp desc;
6976
EOQ
77+
78+
tags = local.access_context_manager_common_tags
7079
}

detections/apigee.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
apigee_common_tags = merge(local.gcp_audit_log_detections_common_tags, {
3+
folder = "Apigee"
34
service = "GCP/Apigee"
45
})
56
}
@@ -25,7 +26,9 @@
2526
query = query.apigee_security_action_disabled
2627
display_columns = local.detection_display_columns
2728

28-
tags = local.apigee_common_tags
29+
tags = merge(local.apigee_common_tags, {
30+
mitre_attack_ids = "TA0005:T1562.001"
31+
})
2932
}
3033

3134
query "apigee_security_action_disabled" {
@@ -40,4 +43,6 @@
4043
order by
4144
timestamp desc;
4245
EOQ
46+
47+
tags = local.apigee_common_tags
4348
}

detections/app_engine.pp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
app_engine_common_tags = merge(local.gcp_audit_log_detections_common_tags, {
3+
folder = "App Engine"
34
service = "GCP/AppEngine"
45
})
56
}
@@ -27,7 +28,9 @@
2728
query = query.app_engine_firewall_ingress_rule_created
2829
display_columns = local.detection_display_columns
2930

30-
tags = local.app_engine_common_tags
31+
tags = merge(local.app_engine_common_tags, {
32+
mitre_attack_ids = "TA0005:T1578.005"
33+
})
3134
}
3235

3336
detection "app_engine_firewall_ingress_rule_updated" {
@@ -38,7 +41,9 @@
3841
query = query.app_engine_firewall_ingress_rule_updated
3942
display_columns = local.detection_display_columns
4043

41-
tags = local.app_engine_common_tags
44+
tags = merge(local.app_engine_common_tags, {
45+
mitre_attack_ids = "TA0005:T1578.005"
46+
})
4247
}
4348

4449
detection "app_engine_firewall_ingress_rule_deleted" {
@@ -49,7 +54,9 @@
4954
query = query.app_engine_firewall_ingress_rule_deleted
5055
display_columns = local.detection_display_columns
5156

52-
tags = local.app_engine_common_tags
57+
tags = merge(local.app_engine_common_tags, {
58+
mitre_attack_ids = "TA0005:T1578.005"
59+
})
5360
}
5461

5562
query "app_engine_firewall_ingress_rule_created" {
@@ -64,6 +71,8 @@
6471
order by
6572
timestamp desc;
6673
EOQ
74+
75+
tags = local.app_engine_common_tags
6776
}
6877

6978
query "app_engine_firewall_ingress_rule_updated" {
@@ -78,6 +87,8 @@
7887
order by
7988
timestamp desc;
8089
EOQ
90+
91+
tags = local.app_engine_common_tags
8192
}
8293

8394
query "app_engine_firewall_ingress_rule_deleted" {
@@ -92,4 +103,6 @@
92103
order by
93104
timestamp desc;
94105
EOQ
106+
107+
tags = local.app_engine_common_tags
95108
}

detections/artifact_registry.pp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
artifact_registry_common_tags = merge(local.gcp_audit_log_detections_common_tags, {
3+
folder = "Artifact Registry"
34
service = "GCP/ArtifactRegistry"
45
})
56
}
@@ -26,7 +27,9 @@
2627
query = query.artifact_registry_repository_deleted
2728
display_columns = local.detection_display_columns
2829

29-
tags = local.artifact_registry_common_tags
30+
tags = merge(local.artifact_registry_common_tags, {
31+
mitre_attack_ids = "TA0005:T1578.003"
32+
})
3033
}
3134

3235
detection "artifact_registry_package_deleted" {
@@ -36,7 +39,9 @@
3639
severity = "low"
3740
query = query.artifact_registry_package_deleted
3841

39-
tags = local.artifact_registry_common_tags
42+
tags = merge(local.app_engine_common_tags, {
43+
mitre_attack_ids = "TA0005:T1578.003"
44+
})
4045
}
4146

4247
query "artifact_registry_package_deleted" {
@@ -51,6 +56,8 @@
5156
order by
5257
timestamp desc;
5358
EOQ
59+
60+
tags = local.artifact_registry_common_tags
5461
}
5562

5663
query "artifact_registry_repository_deleted" {
@@ -65,4 +72,6 @@
6572
order by
6673
timestamp desc;
6774
EOQ
75+
76+
tags = local.artifact_registry_common_tags
6877
}

detections/cloud_run.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
cloud_run_function_common_tags = merge(local.gcp_audit_log_detections_common_tags, {
3+
folder = "Cloud Run Function"
34
service = "GCP/CloudRunFunction"
45
})
56
}
@@ -25,7 +26,9 @@
2526
query = query.cloud_run_function_deleted
2627
display_columns = local.detection_display_columns
2728

28-
tags = local.cloud_run_function_common_tags
29+
tags = merge(local.cloud_run_function_common_tags, {
30+
mitre_attack_ids = "TA0005:T1578.004"
31+
})
2932
}
3033

3134
query "cloud_run_function_deleted" {
@@ -40,4 +43,6 @@
4043
order by
4144
timestamp desc;
4245
EOQ
46+
47+
tags = local.cloud_run_function_common_tags
4348
}

0 commit comments

Comments
 (0)