Skip to content

Commit fe0a9f4

Browse files
[New/Tuning] Docker Socket Enumeration (#4510)
Co-authored-by: Colson Wilhoit <[email protected]>
1 parent 8dfa5da commit fe0a9f4

File tree

2 files changed

+86
-2
lines changed

2 files changed

+86
-2
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[metadata]
2+
creation_date = "2025/03/04"
3+
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
4+
maturity = "production"
5+
min_stack_version = "8.13.0"
6+
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
7+
updated_date = "2025/03/04"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule detects potential Docker socket enumeration activity by monitoring processes that attempt to interact with
13+
the Docker socket file (/var/run/docker.sock). Docker socket enumeration is a common technique used by attackers to
14+
interact with the Docker daemon and perform various operations, such as creating, starting, stopping, and removing
15+
containers. Attackers may abuse Docker socket enumeration to gain unauthorized access to the host system, escalate
16+
privileges, or move laterally within the environment.
17+
"""
18+
from = "now-9m"
19+
index = ["auditbeat-*", "endgame-*", "logs-auditd_manager.auditd-*", "logs-crowdstrike.fdr*", "logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*"]
20+
language = "eql"
21+
license = "Elastic License v2"
22+
name = "Docker Socket Enumeration"
23+
risk_score = 21
24+
rule_id = "dd983e79-22e8-44d1-9173-d57dba514cac"
25+
setup = """## Setup
26+
27+
This rule requires data coming in from Elastic Defend.
28+
29+
### Elastic Defend Integration Setup
30+
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
31+
32+
#### Prerequisite Requirements:
33+
- Fleet is required for Elastic Defend.
34+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
35+
36+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
37+
- Go to the Kibana home page and click "Add integrations".
38+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
39+
- Click "Add Elastic Defend".
40+
- Configure the integration name and optionally add a description.
41+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
42+
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
43+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
44+
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
45+
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
46+
- Click "Save and Continue".
47+
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
48+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
49+
"""
50+
severity = "low"
51+
tags = [
52+
"Domain: Endpoint",
53+
"Domain: Container",
54+
"OS: Linux",
55+
"Use Case: Threat Detection",
56+
"Tactic: Discovery",
57+
"Data Source: Elastic Defend",
58+
"Data Source: Elastic Endgame",
59+
"Data Source: Auditd Manager",
60+
"Data Source: Crowdstrike",
61+
"Data Source: SentinelOne"
62+
]
63+
timestamp_override = "event.ingested"
64+
type = "eql"
65+
query = '''
66+
process where host.os.type == "linux" and event.type == "start" and
67+
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
68+
process.name in ("curl", "socat", "nc", "netcat", "ncat", "nc.traditional") and
69+
process.command_line like ("*/var/run/docker.sock*", "*/run/docker.sock*")
70+
'''
71+
72+
[[rule.threat]]
73+
framework = "MITRE ATT&CK"
74+
75+
[[rule.threat.technique]]
76+
id = "T1613"
77+
name = "Container and Resource Discovery"
78+
reference = "https://attack.mitre.org/techniques/T1613/"
79+
80+
[rule.threat.tactic]
81+
id = "TA0007"
82+
name = "Discovery"
83+
reference = "https://attack.mitre.org/tactics/TA0007/"

rules/linux/execution_unix_socket_communication.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_
44
maturity = "production"
55
min_stack_version = "8.13.0"
66
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
7-
updated_date = "2025/02/04"
7+
updated_date = "2025/03/04"
88

99
[rule]
1010
author = ["Elastic"]
@@ -43,7 +43,8 @@ process where host.os.type == "linux" and event.type == "start" and
4343
(process.name in ("nc", "ncat", "netcat", "nc.openbsd") and
4444
process.args == "-U" and process.args : ("/usr/local/*", "/run/*", "/var/run/*")) or
4545
(process.name == "socat" and
46-
process.args == "-" and process.args : ("UNIX-CLIENT:/usr/local/*", "UNIX-CLIENT:/run/*", "UNIX-CLIENT:/var/run/*"))
46+
process.args == "-" and process.args : ("UNIX-CLIENT:/usr/local/*", "UNIX-CLIENT:/run/*", "UNIX-CLIENT:/var/run/*")) or
47+
(process.name == "curl" and process.args : ("--unix-socket", "--abstract-unix-socket"))
4748
) and
4849
not (
4950
process.args == "/var/run/libvirt/libvirt-sock" or

0 commit comments

Comments
 (0)