Skip to content

Commit 58297ad

Browse files
Add mitre tags (#3)
1 parent 6037d2b commit 58297ad

16 files changed

+115
-42
lines changed

dashboards/activity_dashboard.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@
102102

103103
sql = <<-EOQ
104104
select
105-
split_part(log_name, '%2F', 2) as "Type",
105+
split_part(replace(log_name, '%2F', '/'),'/', 5) as "Type",
106106
count(*) as "Logs"
107107
from
108108
gcp_audit_log
109109
where
110-
split_part(log_name, '%2F', 2) is not null
110+
split_part(replace(log_name, '%2F', '/'),'/', 5) is not null
111111
group by
112-
split_part(log_name, '%2F', 2)
112+
split_part(replace(log_name, '%2F', '/'),'/', 5)
113113
order by
114114
count(*) desc
115115
limit 10;

detections/access_context_manager.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
query = query.access_context_manager_policy_deleted
2828
display_columns = local.detection_display_columns
2929

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

3335
detection "access_context_manager_access_level_deleted" {
@@ -38,7 +40,9 @@
3840
query = query.access_context_manager_access_level_deleted
3941
display_columns = local.detection_display_columns
4042

41-
tags = local.access_context_manager_common_tags
43+
tags = merge(local.access_context_manager_common_tags, {
44+
mitre_attack_ids = "TA0005:T1578.005"
45+
})
4246
}
4347

4448
query "access_context_manager_policy_deleted" {

detections/apigee.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
query = query.apigee_security_action_disabled
2626
display_columns = local.detection_display_columns
2727

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

3133
query "apigee_security_action_disabled" {

detections/app_engine.pp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
query = query.app_engine_firewall_ingress_rule_created
2828
display_columns = local.detection_display_columns
2929

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

3335
detection "app_engine_firewall_ingress_rule_updated" {
@@ -38,7 +40,9 @@
3840
query = query.app_engine_firewall_ingress_rule_updated
3941
display_columns = local.detection_display_columns
4042

41-
tags = local.app_engine_common_tags
43+
tags = merge(local.app_engine_common_tags, {
44+
mitre_attack_ids = "TA0005:T1578.005"
45+
})
4246
}
4347

4448
detection "app_engine_firewall_ingress_rule_deleted" {
@@ -49,7 +53,9 @@
4953
query = query.app_engine_firewall_ingress_rule_deleted
5054
display_columns = local.detection_display_columns
5155

52-
tags = local.app_engine_common_tags
56+
tags = merge(local.app_engine_common_tags, {
57+
mitre_attack_ids = "TA0005:T1578.005"
58+
})
5359
}
5460

5561
query "app_engine_firewall_ingress_rule_created" {

detections/artifact_registry.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
query = query.artifact_registry_repository_deleted
2727
display_columns = local.detection_display_columns
2828

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

3234
detection "artifact_registry_package_deleted" {
@@ -36,7 +38,9 @@
3638
severity = "low"
3739
query = query.artifact_registry_package_deleted
3840

39-
tags = local.artifact_registry_common_tags
41+
tags = merge(local.app_engine_common_tags, {
42+
mitre_attack_ids = "TA0005:T1578.003"
43+
})
4044
}
4145

4246
query "artifact_registry_package_deleted" {

detections/cloud_run.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
query = query.cloud_run_function_deleted
2626
display_columns = local.detection_display_columns
2727

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

3133
query "cloud_run_function_deleted" {

detections/compute.pp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
query = query.compute_vpn_tunnel_deleted
3333
display_columns = local.detection_display_columns
3434

35-
tags = local.compute_common_tags
35+
tags = merge(local.compute_common_tags, {
36+
mitre_attack_ids = " TA0005:T1578.003"
37+
})
3638
}
3739

3840
detection "compute_firewall_rule_deleted" {
@@ -43,7 +45,9 @@
4345
query = query.compute_firewall_rule_deleted
4446
display_columns = local.detection_display_columns
4547

46-
tags = local.compute_common_tags
48+
tags = merge(local.compute_common_tags, {
49+
mitre_attack_ids = "TA0005:T1578.005"
50+
})
4751
}
4852

4953
detection "compute_image_iam_policy_set" {
@@ -54,7 +58,9 @@
5458
query = query.compute_image_iam_policy_set
5559
display_columns = local.detection_display_columns
5660

57-
tags = local.compute_common_tags
61+
tags = merge(local.compute_common_tags, {
62+
mitre_attack_ids = "TA0005:T1578.005"
63+
})
5864
}
5965

6066
detection "compute_disk_iam_policy_set" {
@@ -65,7 +71,9 @@
6571
query = query.compute_disk_iam_policy_set
6672
display_columns = local.detection_display_columns
6773

68-
tags = local.compute_common_tags
74+
tags = merge(local.compute_common_tags, {
75+
mitre_attack_ids = "TA0005:T1578.005"
76+
})
6977
}
7078

7179
detection "compute_snapshot_iam_policy_set" {
@@ -76,7 +84,9 @@
7684
query = query.compute_snapshot_iam_policy_set
7785
display_columns = local.detection_display_columns
7886

79-
tags = local.compute_common_tags
87+
tags = merge(local.compute_common_tags, {
88+
mitre_attack_ids = "TA0005:T1578.005"
89+
})
8090
}
8191

8292
detection "compute_instance_with_public_network_interface" {
@@ -87,7 +97,9 @@
8797
query = query.compute_instance_with_public_network_interface
8898
display_columns = local.detection_display_columns
8999

90-
tags = local.compute_common_tags
100+
tags = merge(local.compute_common_tags, {
101+
mitre_attack_ids = "TA0001:T1133"
102+
})
91103
}
92104

93105
detection "compute_subnetwork_flow_logs_disabled" {
@@ -98,7 +110,9 @@
98110
query = query.compute_subnetwork_flow_logs_disabled
99111
display_columns = local.detection_display_columns
100112

101-
tags = local.compute_common_tags
113+
tags = merge(local.compute_common_tags, {
114+
mitre_attack_ids = "TA0005:T1562.001"
115+
})
102116
}
103117

104118
query "compute_firewall_rule_deleted" {

detections/dlp.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
query = query.dlp_reidentify_content
2626
display_columns = local.detection_display_columns
2727

28-
tags = local.dlp_common_tags
28+
tags = merge(local.dlp_common_tags, {
29+
mitre_attack_ids = "TA0005:T1140"
30+
})
2931
}
3032

3133
query "dlp_reidentify_content" {

detections/dns.pp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
query = query.dns_managed_zone_deleted
3030
display_columns = local.detection_display_columns
3131

32-
tags = local.dns_common_tags
32+
tags = merge(local.dns_common_tags, {
33+
mitre_attack_ids = "TA0040:T1565.001"
34+
})
3335
}
3436

3537
detection "dns_managed_zone_updated" {
@@ -40,7 +42,9 @@
4042
query = query.dns_managed_zone_updated
4143
display_columns = local.detection_display_columns
4244

43-
tags = local.dns_common_tags
45+
tags = merge(local.dns_common_tags, {
46+
mitre_attack_ids = "TA0040:T1565.001"
47+
})
4448
}
4549

4650
detection "dns_record_set_updated" {
@@ -51,7 +55,9 @@
5155
query = query.dns_record_set_updated
5256
display_columns = local.detection_display_columns
5357

54-
tags = local.dns_common_tags
58+
tags = merge(local.dns_common_tags, {
59+
mitre_attack_ids = "TA0040:T1565.001"
60+
})
5561
}
5662

5763
detection "dns_record_set_deleted" {
@@ -62,7 +68,9 @@
6268
query = query.dns_record_set_deleted
6369
display_columns = local.detection_display_columns
6470

65-
tags = local.dns_common_tags
71+
tags = merge(local.dns_common_tags, {
72+
mitre_attack_ids = "TA0040:T1565.001"
73+
})
6674
}
6775

6876
query "dns_managed_zone_deleted" {

detections/iam.pp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
display_columns = local.detection_display_columns
4848

4949
tags = merge(local.iam_common_tags, {
50-
mitre_attack_ids = "TA0001:T1078,TA0003:T1098,TA0003:T1136"
50+
mitre_attack_ids = "TA0001:T1078.004,TA0003:T1098,TA0003:T1136"
5151
})
5252
}
5353

@@ -60,7 +60,7 @@
6060
display_columns = local.detection_display_columns
6161

6262
tags = merge(local.iam_common_tags, {
63-
mitre_attack_ids = "TA0001:T1078,TA0003:T1098"
63+
mitre_attack_ids = "TA0001:T1078.004,TA0003:T1098"
6464
})
6565
}
6666

@@ -72,7 +72,9 @@
7272
query = query.iam_service_account_disabled
7373
display_columns = local.detection_display_columns
7474

75-
tags = local.iam_common_tags
75+
tags = merge(local.iam_common_tags, {
76+
mitre_attack_ids = "TA0040:T1490"
77+
})
7678
}
7779

7880
detection "iam_service_account_token_creator_role_assigned" {
@@ -83,7 +85,9 @@
8385
query = query.iam_service_account_token_creator_role_assigned
8486
display_columns = local.detection_display_columns
8587

86-
tags = local.iam_common_tags
88+
tags = merge(local.iam_common_tags, {
89+
mitre_attack_ids = "TA0003:T1136,TA0005:T1548"
90+
})
8791
}
8892

8993
detection "iam_organization_policy_updated" {
@@ -94,7 +98,9 @@
9498
query = query.iam_organization_policy_updated
9599
display_columns = local.detection_display_columns
96100

97-
tags = local.iam_common_tags
101+
tags = merge(local.iam_common_tags, {
102+
mitre_attack_ids = "TA0005:T1562"
103+
})
98104
}
99105

100106
detection "iam_service_account_access_token_generated" {
@@ -105,7 +111,9 @@
105111
query = query.iam_service_account_access_token_generated
106112
display_columns = local.detection_display_columns
107113

108-
tags = local.iam_common_tags
114+
tags = merge(local.iam_common_tags, {
115+
mitre_attack_ids = "TA0005:T1550, TA0002:T1651"
116+
})
109117
}
110118

111119
detection "iam_service_account_key_deleted" {
@@ -127,7 +135,9 @@
127135
query = query.iam_owner_role_policy_set
128136
display_columns = local.detection_display_columns
129137

130-
tags = local.resourcemanager_common_tags
138+
tags = merge(local.resourcemanager_common_tags, {
139+
mitre_attack_ids = "TA0003:T1098"
140+
})
131141
}
132142

133143
query "iam_service_account_created" {
@@ -273,4 +283,4 @@
273283
order by
274284
timestamp desc;
275285
EOQ
276-
}
286+
}

detections/logging.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
query = query.logging_sink_deleted
2727
display_columns = local.detection_display_columns
2828

29-
tags = local.logging_common_tags
29+
tags = merge(local.logging_common_tags, {
30+
mitre_attack_ids = "TA0005:T1562"
31+
})
3032
}
3133

3234
detection "logging_bucket_deleted" {
@@ -37,7 +39,9 @@
3739
query = query.logging_bucket_deleted
3840
display_columns = local.detection_display_columns
3941

40-
tags = local.logging_common_tags
42+
tags = merge(local.logging_common_tags, {
43+
mitre_attack_ids = "TA0040:T1485"
44+
})
4145
}
4246

4347
query "logging_sink_deleted" {

detections/monitoring.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
query = query.monitoring_metric_descriptor_deleted
2626
display_columns = local.detection_display_columns
2727

28-
tags = local.monitoring_common_tags
28+
tags = merge(local.monitoring_common_tags, {
29+
mitre_attack_ids = "TA0005:T1578.005"
30+
})
2931
}
3032

3133
detection "monitoring_alert_policy_deleted" {
@@ -36,7 +38,9 @@
3638
query = query.monitoring_alert_policy_deleted
3739
display_columns = local.detection_display_columns
3840

39-
tags = local.monitoring_common_tags
41+
tags = merge(local.monitoring_common_tags, {
42+
mitre_attack_ids = "TA0005:T1578.005"
43+
})
4044
}
4145

4246
query "monitoring_metric_descriptor_deleted" {

detections/resource_manager.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
query = query.resource_manager_iam_policy_set
2525
display_columns = local.detection_display_columns
2626

27-
tags = local.resourcemanager_common_tags
27+
28+
tags = merge(local.resourcemanager_common_tags, {
29+
mitre_attack_ids = "TA0005:T1211"
30+
})
2831
}
2932

3033
query "resource_manager_iam_policy_set" {

detections/security_command_center.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
query = query.security_command_center_notification_config_deleted
2626
display_columns = local.detection_display_columns
2727

28-
tags = local.security_command_center_common_tags
28+
tags = merge(local.security_command_center_common_tags, {
29+
mitre_attack_ids = "TA0005:T1211"
30+
})
2931
}
3032

3133
query "security_command_center_notification_config_deleted" {

0 commit comments

Comments
 (0)