Detection rules › YARA-L
sap hanadb user admin actions
Detects administrative user management (Create/Alter/Drop) and schema deletion within SAP HANA DB.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule body
// Copyright 2026 Google LLC. Licensed under Apache-2.0.
rule sap_hanadb_user_admin_actions {
meta:
author = "Google Cloud Security"
description = "Detects administrative user management (Create/Alter/Drop) and schema deletion within SAP HANA DB."
severity = "Medium"
tactic = "TA0003"
technique = "T1136"
events:
$e.metadata.log_type = "SAP_HANA_AUDIT"
$statement = $e.additional.fields["executed_statement"]
(
$statement = /CREATE USER/ nocase or
$statement = /ALTER USER/ nocase or
$statement = /DROP USER/ nocase or
$statement = /DROP SCHEMA/ nocase
)
$user = $e.principal.user.userid
match:
$user over 30m
outcome:
$risk_score = max(70)
$principal_user = array_distinct($user)
$target_user = array_distinct($e.target.user.userid)
$executed_statements = array_distinct($statement)
$system_id = array_distinct($e.target.resource.attribute.labels["system_id"])
$db_name = array_distinct($e.target.resource.name)
condition:
$e
}
YARA-L rule structure
Condition
Fires when at least one $e event in the 30m window.
Events
$e
metadata.log_type = "SAP_HANA_AUDIT"additional.fields["executed_statement"] matches "CREATE USER"additional.fields["executed_statement"] matches "ALTER USER"additional.fields["executed_statement"] matches "DROP USER"additional.fields["executed_statement"] matches "DROP SCHEMA"
Match and correlation
Outcome
Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.
| Field | Expression |
|---|---|
risk_score | max(70) |
principal_user | array_distinct($user) |
target_user | array_distinct($e.target.user.userid) |
executed_statements | array_distinct($statement) |
system_id | array_distinct($e.target.resource.attribute.labels["system_id"]) |
db_name | array_distinct($e.target.resource.name) |