Interactive Shell Launched via Unusual Parent Process in a Container

Last updated 2 months ago on 2025-12-19
Created a year ago on 2025-03-12

About

This rule detects when an interactive shell process is launched via an unusual parent processes inside a container. Interactive processes are typically run in the foreground and require user input, which is unusual behavior for a containerized environment. This activity could indicate an attacker attempting to gain access to the container environment or perform malicious actions.
Tags
Domain: ContainerOS: LinuxUse Case: Threat DetectionTactic: ExecutionData Source: Elastic DefendLanguage: kuery
Severity
medium
Risk Score
47
MITRE ATT&CK™

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

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

Definition

Rule Type
New Terms Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.process*
Related Integrations

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

Query
text code block:
event.category:process and host.os.type:linux and event.type:start and event.action:exec and process.entry_leader.entry_meta.type:container and process.interactive:true and process.name:(sh or bash or dash or tcsh or csh or zsh or ksh or fish) and not ( process.parent.name:(dpkg or runc or tini or frontend or elastic-agent or agentbeat or dpkg-query or ansible-playbook or gpgv or apt or apt-get) or process.parent.command_line:"runc init" )

Install detection rules in Elastic Security

Detect Interactive Shell Launched via Unusual Parent Process in a Container 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).