Privileged Docker Container Creation
This rule leverages the new_terms rule type to identify the creation of a potentially unsafe docker container from an
unusual parent process. Attackers can use the --privileged
flag to create containers with escalated privileges,
which can lead to trivial privilege escalation, docker escaping and persistence.
access.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/07/10"
3integration = ["endpoint"]
4maturity = "production"
5min_stack_comments = "The New Term rule type used in this rule was added in Elastic 8.4"
6min_stack_version = "8.4.0"
7updated_date = "2024/07/10"
8
9[rule]
10author = ["Elastic"]
11description = """
12This rule leverages the new_terms rule type to identify the creation of a potentially unsafe docker container from an
13unusual parent process. Attackers can use the `--privileged` flag to create containers with escalated privileges,
14which can lead to trivial privilege escalation, docker escaping and persistence.
15access.
16"""
17from = "now-9m"
18index = ["logs-endpoint.events.process*"]
19language = "kuery"
20license = "Elastic License v2"
21name = "Privileged Docker Container Creation"
22risk_score = 21
23rule_id = "a80d96cd-1164-41b3-9852-ef58724be496"
24setup = """## Setup
25This rule requires data coming in from Elastic Defend.
26### Elastic Defend Integration Setup
27Elastic 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.
28#### Prerequisite Requirements:
29- Fleet is required for Elastic Defend.
30- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
31#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
32- Go to the Kibana home page and click "Add integrations".
33- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
34- Click "Add Elastic Defend".
35- Configure the integration name and optionally add a description.
36- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
37- 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).
38- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
39- 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.
40For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
41- Click "Save and Continue".
42- 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.
43For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
44"""
45severity = "low"
46tags = [
47 "Domain: Endpoint",
48 "Domain: Container",
49 "OS: Linux",
50 "Use Case: Threat Detection",
51 "Tactic: Execution",
52 "Data Source: Elastic Defend"
53 ]
54timestamp_override = "event.ingested"
55type = "new_terms"
56query = '''
57host.os.type:linux and event.category:process and event.type:start and event.action:exec and process.name:docker and
58process.args:(run and --privileged)
59'''
60[[rule.threat]]
61framework = "MITRE ATT&CK"
62
63[[rule.threat.technique]]
64id = "T1609"
65name = "Container Administration Command"
66reference = "https://attack.mitre.org/techniques/T1609/"
67
68[[rule.threat.technique]]
69id = "T1059"
70name = "Command and Scripting Interpreter"
71reference = "https://attack.mitre.org/techniques/T1059/"
72
73[[rule.threat.technique.subtechnique]]
74id = "T1059.004"
75name = "Unix Shell"
76reference = "https://attack.mitre.org/techniques/T1059/004/"
77
78[rule.threat.tactic]
79id = "TA0002"
80name = "Execution"
81reference = "https://attack.mitre.org/tactics/TA0002/"
82
83[[rule.threat]]
84framework = "MITRE ATT&CK"
85
86[[rule.threat.technique]]
87id = "T1611"
88name = "Escape to Host"
89reference = "https://attack.mitre.org/techniques/T1611/"
90
91[rule.threat.tactic]
92id = "TA0004"
93name = "Privilege Escalation"
94reference = "https://attack.mitre.org/tactics/TA0004/"
95
96[rule.new_terms]
97field = "new_terms_fields"
98value = ["process.parent.executable"]
99
100[[rule.new_terms.history_window_start]]
101field = "history_window_start"
102value = "now-14d"
Related rules
- Egress Connection from Entrypoint in Container
- Docker Escape via Nsenter
- BPF filter applied using TC
- Binary Executed from Shared Memory Directory
- EggShell Backdoor Execution