Detection rules › YARA-L

YARA-L rules: 2m

Google Workspace Ownership Transferred On Google Drive

#
Severity
high
Type
Alert
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Identifies when a Google Workspace user transfers the ownership of a file.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

rule google_workspace_ownership_transferred_on_google_drive {

  meta:
    author = "Google Cloud Security"
    description = "Identifies when a Google Workspace user transfers the ownership of a file."
    rule_id = "mr_05cddcc9-abf6-4c4c-9518-e2218a1f5c84"
    rule_name = "Google Workspace Ownership Transferred On Google Drive"
    mitre_attack_tactic = "Collection"
    mitre_attack_technique = "Data Staged: Remote Data Staging"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1074/002/"
    mitre_attack_version = "v13.1"
    type = "Alert"
    data_source = "Workspace Activity"
    severity = "High"
    priority = "High"

  events:
    $ws.metadata.vendor_name = "Google Workspace"
    $ws.metadata.product_name = "admin"
    $ws.metadata.product_event_type = "CREATE_DATA_TRANSFER_REQUEST"
    $ws.security_result.category_details = "USER_SETTINGS"

  outcome:
    $risk_score = max(70)
    $mitre_attack_tactic = "Collection"
    $mitre_attack_technique = "Data Staged: Remote Data Staging"
    $mitre_attack_technique_id = "T1074.002"
    $event_count = count_distinct($ws.metadata.id)
    $principal_ip = array_distinct($ws.principal.ip)
    $principal_country = array_distinct($ws.principal.ip_geo_artifact.location.country_or_region)
    $principal_state = array_distinct($ws.principal.ip_geo_artifact.location.state)
    $principal_user_emails = array_distinct($ws.principal.user.email_addresses)
    $target_user_emails = array_distinct($ws.target.user.email_addresses)
    $principal_user_id = $ws.principal.user.userid
    $target_application = $ws.target.application
    $src_user_emails = array_distinct($ws.src.user.email_addresses)

  condition:
    $ws
}

YARA-L Rule Structure

Condition

Fires when at least one $ws event.

Events

$ws

  • metadata.product_event_type = "CREATE_DATA_TRANSFER_REQUEST"
  • security_result.category_details = "USER_SETTINGS"

Outcome

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

FieldExpression
risk_scoremax(70)
event_countcount_distinct($ws.metadata.id)
principal_iparray_distinct($ws.principal.ip)
principal_countryarray_distinct($ws.principal.ip_geo_artifact.location.country_or_region)
principal_statearray_distinct($ws.principal.ip_geo_artifact.location.state)
principal_user_emailsarray_distinct($ws.principal.user.email_addresses)
target_user_emailsarray_distinct($ws.target.user.email_addresses)
principal_user_id$ws.principal.user.userid
target_application$ws.target.application
src_user_emailsarray_distinct($ws.src.user.email_addresses)

sap data changed during debugging

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

Detects in-memory data changes (CUL) during an ABAP debugging session. Identifies if the debugger is the same as the session owner.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

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

rule sap_data_changed_during_debugging {

  meta:
    author = "Google Cloud Security"
    description = "Detects in-memory data changes (CUL) during an ABAP debugging session. Identifies if the debugger is the same as the session owner."
    severity = "Critical"
    tactic = "TA0005"
    technique = "T1564"

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

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

    $debugger = $e.additional.fields["param1_1"]
    $session_owner = $e.principal.user.userid

    // exclusions
    not $debugger in %sap_admin_users.user

  match:
    $session_owner over 30m

  outcome:
    $risk_score = 90
    $target_sid = array_distinct($e.target.application)
    $debugging_user = array_distinct($debugger)
    $source_user = array_distinct($session_owner)

    $source_user_is_debugger = array_distinct(if($debugger = $session_owner, "true", "false"))

    $change_field = array_distinct($e.additional.fields["param2_1"])
    $change = array_distinct($e.additional.fields["param3_1"])
    $method = array_distinct(re.capture($e.additional.fields["paramx_1"], `Meth:(.*?),\s`))

  condition:
    $e
}

YARA-L Rule Structure

Condition

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

Events

$e

  • metadata.log_type = "SAP_SECURITY_AUDIT"
  • additional.fields["msg_1"] = "CUL"
  • additional.fields["param1_1"] in "%sap_admin_users.user"

Match and Correlation

Match key
$session_owner
Within
30m

Outcome

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

FieldExpression
risk_score90
target_sidarray_distinct($e.target.application)
debugging_userarray_distinct($debugger)
source_userarray_distinct($session_owner)
source_user_is_debuggerarray_distinct(if($debugger = $session_owner, "true", "false"))
change_fieldarray_distinct($e.additional.fields["param2_1"])
changearray_distinct($e.additional.fields["param3_1"])
methodarray_distinct(re.capture($e.additional.fields["paramx_1"], `Meth:(.*?),\s`))

Back to all YARA-L rules