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

TacticTechniques
Defense Impairment

Rule body

// Copyright 2026 Google LLC. Licensed under Apache-2.0.

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
}

YARA-L rule structure

Condition

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"

Match and correlation

Match key
$user
Within
30m

Outcome

Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.

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)