sap_sensitive_role_assignment_correlation


Description

Correlates SAP Change Documents with Security Audit logs to detect sensitive role assignments and self-assignments.

Query · yara_l

events:
    $change.metadata.log_type = "SAP_CHANGE_DOCUMENT"
    $change.target.resource.name = "PFCG"
    $change.target.resource.attribute.labels["TABNAME"] = "AGR_USERS"
    $change.target.resource.attribute.labels["CHANGE_IND"] = "I"

    $client = $change.target.resource.attribute.labels["MANDANT"]
    $target_user = $change.target.resource.attribute.labels["TABKEY"]

    //joining on user value
    $user = $change.principal.user.userid
    $user = $audit.principal.user.userid

    $audit.metadata.log_type = "SAP_SECURITY_AUDIT"
    $client = $audit.target.resource.attribute.labels["slgmand"]

    not $user in %sap_admin_users.user

  match:
    $user, $client over 30m

  outcome:
    $assigned_role = array_distinct($change.target.resource.product_object_id)
    $principal_ip = array_distinct($audit.principal.ip)
    $audit_description = array_distinct($audit.metadata.description)

  condition:
    $change and $audit
Raw source sap_sensitive_role_assignment_correlation · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule sap_sensitive_role_assignment_correlation {

  meta:
    author = "Google Cloud Security"
    description = "Correlates SAP Change Documents with Security Audit logs to detect sensitive role assignments and self-assignments."
    severity = "Medium"
    tactic = "TA0004"
    technique = "T1098"

  events:
    $change.metadata.log_type = "SAP_CHANGE_DOCUMENT"
    $change.target.resource.name = "PFCG"
    $change.target.resource.attribute.labels["TABNAME"] = "AGR_USERS"
    $change.target.resource.attribute.labels["CHANGE_IND"] = "I"

    $client = $change.target.resource.attribute.labels["MANDANT"]
    $target_user = $change.target.resource.attribute.labels["TABKEY"]

    //joining on user value
    $user = $change.principal.user.userid
    $user = $audit.principal.user.userid

    $audit.metadata.log_type = "SAP_SECURITY_AUDIT"
    $client = $audit.target.resource.attribute.labels["slgmand"]

    not $user in %sap_admin_users.user

  match:
    $user, $client over 30m

  outcome:
    $assigned_role = array_distinct($change.target.resource.product_object_id)
    $principal_ip = array_distinct($audit.principal.ip)
    $audit_description = array_distinct($audit.metadata.description)

  condition:
    $change and $audit
}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.