Detection rules › YARA-L

sap hanadb deactivation of audit trail

Severity
critical
Time window
30m
Match by
user
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detects the deactivation of the global auditing state in SAP HANA, which stops all audit logging.

MITRE ATT&CK coverage

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_hanadb_deactivation_of_audit_trail {

  meta:
    author = "Google Cloud Security"
    description = "Detects the deactivation of the global auditing state in SAP HANA, which stops all audit logging."
    severity = "Critical"
    tactic = "TA0005"
    technique = "T1562.001"

  events:
    $e.metadata.product_name = "SAP_HANA_AUDIT"

    (
        $e.metadata.product_event_type = /AUDIT CONFIGURATION/ nocase and
        $e.target.resource.attribute.labels["parameter"] = "global_auditing_state" nocase and
        $e.target.resource.attribute.labels["new_value"] = "false" nocase
    ) or
    (
        $e.metadata.product_event_type = "SYSTEM CONFIGURATION CHANGE" nocase and
        $e.additional.fields["executed_statement"] = /ALTER SYSTEM ALTER CONFIGURATION/ nocase and
        $e.additional.fields["executed_statement"] = /UNSET/ nocase
    )
    $user = $e.principal.user.userid

  match:
    $user over 30m

  outcome:
    $risk_score = max(95)
    $principal_user = array_distinct($user)
    $system_id = array_distinct($e.target.resource.attribute.labels["system_id"])
    $prev_value = array_distinct($e.target.resource.attribute.labels["old_value"])
    $new_value = array_distinct($e.target.resource.attribute.labels["new_value"])
    $action = array_distinct($e.security_result.action)

  condition:
    $e
}

Detection logic

Fires when at least one $e event in the 30m window.

Events

$e

  • metadata.product_event_type matches "AUDIT CONFIGURATION"
  • target.resource.attribute.labels["parameter"] = "global_auditing_state"
  • target.resource.attribute.labels["new_value"] = "false"
  • metadata.product_event_type = "SYSTEM CONFIGURATION CHANGE"
  • additional.fields["executed_statement"] matches "ALTER SYSTEM ALTER CONFIGURATION"
  • additional.fields["executed_statement"] matches "UNSET"

Correlation

Match key
$user
Within
30m

Outcome

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

FieldExpression
risk_scoremax(95)
principal_userarray_distinct($user)
system_idarray_distinct($e.target.resource.attribute.labels["system_id"])
prev_valuearray_distinct($e.target.resource.attribute.labels["old_value"])
new_valuearray_distinct($e.target.resource.attribute.labels["new_value"])
actionarray_distinct($e.security_result.action)