Docker Socket Enumeration

This rule detects potential Docker socket enumeration activity by monitoring processes that attempt to interact with the Docker socket file (/var/run/docker.sock). Docker socket enumeration is a common technique used by attackers to interact with the Docker daemon and perform various operations, such as creating, starting, stopping, and removing containers. Attackers may abuse Docker socket enumeration to gain unauthorized access to the host system, escalate privileges, or move laterally within the environment.

Elastic rule (View on GitHub)

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

Related rules

to-top