Detection rules › YARA-L
sap change documents sensitive profile assignment
Detects the assignment of highly privileged SAP profiles via Change Documents.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | T1098 Account Manipulation |
Rule body yaral
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
rule sap_change_documents_sensitive_profile_assignment {
meta:
author = "Google Cloud Security"
description = "Detects the assignment of highly privileged SAP profiles via Change Documents."
severity = "Critical"
tactic = "TA0004"
technique = "T1098"
events:
$e.metadata.log_type = "SAP_CHANGE_DOCUMENT"
$e.target.resource.attribute.labels["TABKEY"] = /^SAP_ALL$|^SAP_NEW$/
$e.target.resource.name = "IDENTITY"
$principal_user = $e.principal.user.userid
match:
$principal_user over 30m
outcome:
$target_user = array_distinct($e.target.resource.product_object_id)
$tcode = array_distinct($e.target.application)
$tabname = array_distinct($e.target.resource.attribute.labels["TABNAME"])
$sensitive_profile_assigned = array_distinct($e.target.resource.attribute.labels["TABKEY"])
condition:
$e
}
Detection logic
Fires when at least one $e event in the 30m window.
Events
$e
metadata.log_type = "SAP_CHANGE_DOCUMENT"target.resource.attribute.labels["TABKEY"] matches "^SAP_ALL$|^SAP_NEW$"target.resource.name = "IDENTITY"
Correlation
Outcome
Fields the detection emits on a match. $risk_score drives alerting; Chronicle surfaces the rest on the detection.
| Field | Expression |
|---|---|
target_user | array_distinct($e.target.resource.product_object_id) |
tcode | array_distinct($e.target.application) |
tabname | array_distinct($e.target.resource.attribute.labels["TABNAME"]) |
sensitive_profile_assigned | array_distinct($e.target.resource.attribute.labels["TABKEY"]) |