Google Chronicle high experimental yara-l

sap_btp_workzone_role_collection_tampering

A Build Work Zone role was added to or removed from a BTP role collection

View Source

Detection Logic

/*
 * 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_btp_workzone_role_collection_tampering {

  meta:
    author = "Google Cloud Security"
    description = "A Build Work Zone role was added to or removed from a BTP role collection"
    severity = "High"
    tactic = "TA0004"
    technique = "T1098.003"

  events:
    $e.metadata.log_type = "SAP_BTP"

    $e.security_result.detection_fields["object_id_tableName"] = "xsrolecollection2role" nocase
    $e.security_result.detection_fields["object_id_role_roletemplate_app_appid"] = /portal-cf-service/ nocase

    $tenant = $e.security_result.detection_fields["tenant"]
    $user = strings.coalesce($e.principal.user.user_display_name, $e.principal.user.userid)

    not $e.principal.user.userid            = /^sb-/ nocase
    not $e.principal.user.user_display_name = /^sb-/ nocase

  match:
    $user, $tenant over 1h

  outcome:
    $risk_score = max(if($e.security_result.detection_fields["object_id_role_name"] = /admin
| super/ nocase, 95, 80))
    $crud_type = array_distinct($e.security_result.detection_fields["object_id_crudType"])
    $role_name = array_distinct($e.security_result.detection_fields["object_id_role_name"])
    $role_collection = array_distinct($e.security_result.detection_fields["object_id_rolecollection_name"])
    $role_app_id = array_distinct($e.security_result.detection_fields["object_id_role_roletemplate_app_appid"])
    $mapping_changes = count_distinct($e.security_result.detection_fields["message_uuid"])

  condition:
    $e
}

Field Validations

Loading…

Comments (0)

Loading comments...