File Execution Permission Modification Detected via Defend for Containers

Last updated 21 days ago on 2026-03-05
Created 3 years ago on 2023-04-26

About

This rule detects when chmod is used to add the execute permission to a file inside a container. Modifying file permissions to make a file executable could indicate malicious activity, as an attacker may attempt to run unauthorized or malicious code inside the container.
Tags
Data Source: Elastic Defend for ContainersDomain: ContainerOS: LinuxUse Case: Threat DetectionTactic: ExecutionTactic: Defense EvasionLanguage: eql
Severity
low
Risk Score
21
MITRE ATT&CK™

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

Defense Evasion (TA0005)(external, opens in a new tab or window)

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

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-cloud_defend.file*logs-cloud_defend.process*
Related Integrations

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

Query
text code block:
any where event.category in ("file", "process") and event.type in ("change", "creation", "start") and ( process.name == "chmod" or ( /* account for tools that execute utilities as a subprocess, in this case the target utility name will appear as a process arg */ process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and process.args in ( "chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod" ) and /* default exclusion list to not FP on default multi-process commands */ not process.args in ( "which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which", "man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man" ) ) ) and process.args in ("4755", "755", "777", "0777", "444", "+x", "a+x") and container.id like "?*" and not process.args == "-x"

Install detection rules in Elastic Security

Detect File Execution Permission Modification Detected via Defend for Containers 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).