Skip to content

Commit 23e103b

Browse files
authored
Update credential_access_multi_could_secrets_via_api.toml
1 parent 29bd7db commit 23e103b

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

rules/cross-platform/credential_access_multi_could_secrets_via_api.toml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,16 @@ FROM logs-azure.platformlogs-*, logs-azure.activitylogs-*, logs-aws.cloudtrail-*
114114
(
115115
/* AWS Secrets Manager */
116116
(event.dataset == "aws.cloudtrail" AND event.provider == "secretsmanager.amazonaws.com" AND event.action == "GetSecretValue") OR
117-
118117
// Azure Key Vault (platform logs)
119118
(event.dataset == "azure.platformlogs" AND event.action IN ("SecretGet", "KeyGet")) or
120-
121119
/* Azure Key Vault (activity logs) */
122120
(event.dataset == "azure.activitylogs" AND azure.activitylogs.operation_name IN ("MICROSOFT.KEYVAULT/VAULTS/SECRETS/LIST", "MICROSOFT.KEYVAULT/VAULTS/SECRETS/GET")) OR
123-
124121
/* Azure Managed HSM secret */
125122
(event.dataset == "azure.activitylogs" AND azure.activitylogs.operation_name LIKE "MICROSOFT.KEYVAULT/managedHSM/keys/*") OR
126-
127123
/* Google Secret Manager */
128124
(event.dataset IN ("googlecloud.audit", "gcp.audit") AND
129125
event.action IN ("google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion", "google.cloud.secretmanager.v1.SecretManagerService.GetSecretRequest"))
130-
131126
) AND source.ip IS NOT NULL
132-
133127
// Unified user identity (raw)
134128
| EVAL Esql_priv.user_id =
135129
COALESCE(
@@ -138,52 +132,45 @@ FROM logs-azure.platformlogs-*, logs-azure.activitylogs-*, logs-aws.cloudtrail-*
138132
azure.platformlogs.identity.claim.upn,
139133
NULL
140134
)
141-
142135
// Cloud vendor label based on dataset
143136
| EVAL Esql.cloud_vendor = CASE(
144137
event.dataset == "aws.cloudtrail", "aws",
145138
event.dataset IN ("azure.platformlogs","azure.activitylogs"), "azure",
146139
event.dataset IN ("googlecloud.audit","gcp.audit"), "gcp",
147140
"unknown"
148141
)
149-
150142
// Vendor+tenant label, e.g. aws:123456789012, azure:tenant, gcp:project
151143
| EVAL Esql.tenant_label = CASE(
152144
Esql.cloud_vendor == "aws", CONCAT("aws:", cloud.account.id),
153145
Esql.cloud_vendor == "azure", CONCAT("azure:", cloud.account.id),
154146
Esql.cloud_vendor == "gcp", CONCAT("gcp:", cloud.account.id),
155147
NULL
156148
)
157-
158149
| STATS
159150
// Core counts
160151
Esql.events_count = COUNT(*),
161152
Esql.vendor_count_distinct = COUNT_DISTINCT(Esql.cloud_vendor),
162-
163153
// Action & data source context
164154
Esql.event_action_values = VALUES(event.action),
165155
Esql.data_source_values = VALUES(event.dataset),
166-
167156
// Cloud vendor + tenant context
168157
Esql.cloud_vendor_values = VALUES(Esql.cloud_vendor),
169158
Esql.tenant_label_values = VALUES(Esql.tenant_label),
170-
171159
// Hyperscaler-specific IDs
172160
Esql.aws_account_id_values = VALUES(CASE(Esql.cloud_vendor == "aws", cloud.account.id, NULL)),
173161
Esql.azure_tenant_id_values = VALUES(CASE(Esql.cloud_vendor == "azure", cloud.account.id, NULL)),
174162
Esql.gcp_project_id_values = VALUES(CASE(Esql.cloud_vendor == "gcp", cloud.account.id, NULL)),
175-
176163
// Generic cloud metadata
177164
Esql.cloud_region_values = VALUES(cloud.region),
178165
Esql.cloud_service_name_values = VALUES(cloud.service.name),
179-
180166
// Identity (privileged)
181167
Esql_priv.user_values = VALUES(Esql_priv.user_id),
182168
Esql_priv.client_user_id_values = VALUES(client.user.id),
183169
Esql_priv.aws_user_identity_arn_values = VALUES(aws.cloudtrail.user_identity.arn),
184-
Esql_priv.azure_upn_values = VALUES(azure.platformlogs.identity.claim.upn)
170+
Esql_priv.azure_upn_values = VALUES(azure.platformlogs.identity.claim.upn),
171+
// Namespace values
172+
Esql.data_stream_namespace_values = VALUES(data_stream.namespace)
185173
BY source.ip
186-
187174
// Require multi-vendor cred-access from same source IP
188175
| WHERE Esql.vendor_count_distinct >= 2
189176
| SORT Esql.events_count DESC

0 commit comments

Comments
 (0)