Shell or Suspicious Process Spawned by Ray Worker

Last updated 3 days ago on 2026-10-29
Created 3 days ago on 2026-10-29

About

Detects a Ray worker (`ray/_private/workers/default_worker.py`) spawning a shell, an inline Python command (`python -c` / `python3 -c`), or a discovery or download utility. Ray runs job entrypoints from that worker through a shell, so a Python reverse shell shows up as `sh -c` or `bash -c` whose command line contains `python -c` and the program it starts, such as `/bin/sh -i`. On an exposed cluster this is exploitation of the public-facing Ray jobs API (CVE-2023-48022). Ray commonly hosts LLM training, fine-tuning, and serving, so this can be an attack on that infrastructure: theft of model weights, datasets, or API and cloud tokens, tampering with a served model, or use of the GPUs for cryptomining.
Tags
Domain: EndpointOS: WindowsOS: LinuxOS: macOSUse Case: Threat DetectionTactic: Initial AccessTactic: ExecutionTactic: DiscoveryData Source: Elastic DefendNoise: HighThreat: Vulnerability ExploitPerformance: NormalRule Type: ES|QLPlatform: WindowsPlatform: LinuxPlatform: macOSVuln: CVE-2023-48022Language: esql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Initial Access (TA0001)(external, opens in a new tab or window)

Execution (TA0002)(external, opens in a new tab or window)

Discovery (TA0007)(external, opens in a new tab or window)

Command and Control (TA0011)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
FROM logs-endpoint.events.process-* METADATA _id, _version, _index | WHERE KQL("""event.category:process and event.type:start""") AND TO_LOWER(process.parent.name) LIKE "python*" AND ( TO_LOWER(process.parent.command_line) LIKE """*\\ray\\_private\\workers\\default_worker.py*""" OR TO_LOWER(process.parent.command_line) LIKE "*/ray/_private/workers/default_worker.py*" ) AND ( TO_LOWER(process.name) IN ( "cmd.exe", "powershell.exe", "pwsh.exe", "bash", "bash.exe", "sh", "zsh", "dash", "curl", "curl.exe", "wget", "wget.exe", "whoami", "whoami.exe", "id", "uname", "hostname", "hostname.exe" ) // Direct python -c child of the worker. OR ( TO_LOWER(process.name) LIKE "python*" AND MV_CONTAINS(process.args, "-c") ) ) | KEEP _id, _version, _index, data_stream.namespace, @timestamp, host.name, host.id, host.os.type, agent.id, user.name, user.domain, process.name, process.executable, process.command_line, process.args, process.parent.name, process.parent.executable, process.parent.command_line, process.parent.entity_id

Install detection rules in Elastic Security

Detect Shell or Suspicious Process Spawned by Ray Worker in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).