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