Sensitive Keys Or Passwords Search Detected via Defend for Containers

Last updated 16 days ago on 2026-07-29
Created 3 years ago on 2023-05-12

About

This rule detects the use of system search utilities like grep and find to search for private SSH keys or passwords inside a container. Unauthorized access to these sensitive files could lead to further compromise of the container environment or facilitate a container breakout to the underlying host machine.
Tags
Data Source: Elastic Defend for ContainersDomain: ContainerOS: LinuxUse Case: Threat DetectionTactic: Credential AccessLanguage: eql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Credential Access (TA0006)(external, opens in a new tab or window)

Collection (TA0009)(external, opens in a new tab or window)

Discovery (TA0007)(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.process*
Related Integrations

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

Query
text code block:
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and ( process.name in ("grep", "egrep", "fgrep", "find", "locate", "mlocate", "cat", "sed", "awk") 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 ( "grep", "/bin/grep", "/usr/bin/grep", "/usr/local/bin/grep", "egrep", "/bin/egrep", "/usr/bin/egrep", "/usr/local/bin/egrep", "fgrep", "/bin/fgrep", "/usr/bin/fgrep", "/usr/local/bin/fgrep", "find", "/bin/find", "/usr/bin/find", "/usr/local/bin/find", "locate", "/bin/locate", "/usr/bin/locate", "/usr/local/bin/locate", "mlocate", "/bin/mlocate", "/usr/bin/mlocate", "/usr/local/bin/mlocate", "cat", "/bin/cat", "/usr/bin/cat", "/usr/local/bin/cat", "sed", "/bin/sed", "/usr/bin/sed", "/usr/local/bin/sed", "awk", "/bin/awk", "/usr/bin/awk", "/usr/local/bin/awk" ) 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", "chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod", "chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown" ) ) ) and process.args like~ ( "*BEGIN PRIVATE*", "*BEGIN OPENSSH PRIVATE*", "*BEGIN RSA PRIVATE*", "*BEGIN DSA PRIVATE*", "*BEGIN EC PRIVATE*", "*password*", "*ssh*", "*id_rsa*", "*id_dsa*" ) and container.id like "*"

Install detection rules in Elastic Security

Detect Sensitive Keys Or Passwords Search 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).