Detection rules › YARA-L

sap multiple password changes

Severity
medium
Time window
3h
Match by
source_user
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detects multiple password changes (BU2) by a single actor or targeting a single user across systems.

MITRE ATT&CK coverage

TacticTechniques
Privilege EscalationT1098 Account Manipulation

Rule body yaral

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

  meta:
    author = "Google Cloud Security"
    description = "Detects multiple password changes (BU2) by a single actor or targeting a single user across systems."
    severity = "Medium"
    tactic = "TA0004"
    technique = "T1098"

  events:
    $e.metadata.product_name = "SAP security audit"

    $e.additional.fields["msg_1"] = "BU2"

    $source_user = $e.principal.user.userid
    $target_user = $e.additional.fields["param2_1"]
    $client = $e.target.resource.attribute.labels["slgmand_1"]

  match:
    $source_user over 3h

  outcome:
    $total_changes = count($e.metadata.product_log_id)
    $distinct_targets = count_distinct($target_user)
    $distinct_clients = count_distinct($client)
    $admin_email = array_distinct($e.principal.user.email_addresses)
    $target_users = array_distinct($target_user)
    $terminal_ips = array_distinct($e.principal.ip)

  condition:
    #e >= 3 or #target_user >= 3
}

Detection logic

Fires when $e occurs at least 3 times in the 3h window or $target_user occurs at least 3 times in the 3h window.

Events

$e

  • additional.fields["msg_1"] = "BU2"

Correlation

Match key
$source_user
Within
3h

Outcome

Fields the detection emits on a match. $risk_score drives alerting; Chronicle surfaces the rest on the detection.

FieldExpression
total_changescount($e.metadata.product_log_id)
distinct_targetscount_distinct($target_user)
distinct_clientscount_distinct($client)
admin_emailarray_distinct($e.principal.user.email_addresses)
target_usersarray_distinct($target_user)
terminal_ipsarray_distinct($e.principal.ip)