sap_sensitive_role_authorization_modification


Description

Detects changes to authorization objects within defined sensitive roles. Correlates with login audit logs for session context.

Query · yara_l

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

    $role_id = $change.target.resource.product_object_id
    $role_id in %sap_sensitive_roles.role

    //join
    $user = $change.principal.user.userid
    $user = $audit.principal.user.userid

    $audit.metadata.log_type = "SAP_SECURITY_AUDIT"
    $audit.additional.fields["msg_1"] = /^AU1$|^AU5$/

    not $user in %sap_admin_users.user

  match:
    $user over 12h

  outcome:
    $risk_score = 85
    $changed_role = array_distinct($role_id)
    $auth_objects = array_distinct($change.target.resource.attribute.labels["TABKEY"])
    $terminal_ip = array_distinct($audit.principal.ip)
    $terminal_host = array_distinct($audit.principal.hostname)
    $transaction = array_distinct($change.target.application)

    $time_diff_minutes = max(timestamp.get_minute($change.metadata.event_timestamp.seconds) - timestamp.get_minute($audit.metadata.event_timestamp.seconds))

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

  meta:
    author = "Google Cloud Security"
    description = "Detects changes to authorization objects within defined sensitive roles. Correlates with login audit logs for session context."
    severity = "High"
    tactic = "TA0004"
    technique = "T1098"

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

    $role_id = $change.target.resource.product_object_id
    $role_id in %sap_sensitive_roles.role

    //join
    $user = $change.principal.user.userid
    $user = $audit.principal.user.userid

    $audit.metadata.log_type = "SAP_SECURITY_AUDIT"
    $audit.additional.fields["msg_1"] = /^AU1$|^AU5$/

    not $user in %sap_admin_users.user

  match:
    $user over 12h

  outcome:
    $risk_score = 85
    $changed_role = array_distinct($role_id)
    $auth_objects = array_distinct($change.target.resource.attribute.labels["TABKEY"])
    $terminal_ip = array_distinct($audit.principal.ip)
    $terminal_host = array_distinct($audit.principal.hostname)
    $transaction = array_distinct($change.target.application)

    $time_diff_minutes = max(timestamp.get_minute($change.metadata.event_timestamp.seconds) - timestamp.get_minute($audit.metadata.event_timestamp.seconds))

  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.