Detection rules › YARA-L

sap change documents sensitive profile assignment

Severity
critical
Time window
30m
Match by
principal_user
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detects the assignment of highly privileged SAP profiles via Change Documents.

MITRE ATT&CK coverage

TacticTechniques
Privilege Escalation

Rule body

// Copyright 2026 Google LLC. Licensed under Apache-2.0.

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

}

YARA-L rule structure

Condition

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"

Match and correlation

Match key
$principal_user
Within
30m

Outcome

Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.

FieldExpression
target_userarray_distinct($e.target.resource.product_object_id)
tcodearray_distinct($e.target.application)
tabnamearray_distinct($e.target.resource.attribute.labels["TABNAME"])
sensitive_profile_assignedarray_distinct($e.target.resource.attribute.labels["TABKEY"])