T1543.005 Sumo Logic CSE · Sumo

Detect Container Service in Sumo Logic CSE

Adversaries may create or modify container or container cluster management tools that run as daemons, agents, or services on individual hosts. These include software for creating and managing individual containers, such as Docker and Podman, as well as container cluster node-level agents such as kubelet. By modifying these services, an adversary may achieve persistence or escalate their privileges on a host. Common abuse patterns include using 'docker run' or 'podman run' with the '--restart=always' directive to configure a container to persistently restart after daemon restarts or host reboots, using '--privileged', '--pid=host', or '--net=host' flags to break container isolation and gain access to the underlying host kernel, bind-mounting the root filesystem ('-v /:/') to read or modify host files, and leveraging Kubernetes DaemonSets to deploy malicious containers persistently across all current and future cluster nodes. Threat actor groups including TeamTNT have exploited exposed Docker APIs to deploy cryptomining and backdoor containers with restart=always policies. Privilege escalation via docker group membership is documented in GTFOBins and widely exploited in post-exploitation scenarios.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1543 Create or Modify System Process
Sub-technique
T1543.005 Container Service
Canonical reference
https://attack.mitre.org/techniques/T1543/005/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
// T1543.005 - Container Service Persistence and Privilege Escalation
(_sourceCategory=*linux* OR _sourceCategory=*audit* OR _sourceCategory=*syslog*)
| where _raw matches /(?i)(docker|podman|nerdctl)\s+run/
| parse regex "(?i)(?P<container_runtime>docker|podman|nerdctl)\s+(?:.*?)run\s+(?P<run_args>.*)" nodrop
| if (matches(run_args, "(?i)--restart.{0,3}always"), 1, 0) as persistence_flag
| if (matches(run_args, "(?i)(--privileged|--pid[=\s]host|--net[=\s]host|--network[=\s]host|--cap-add[=\s](SYS_ADMIN|ALL))"), 1, 0) as privileged_flag
| if (matches(run_args, "(?i)(-v\s+/[^:]*:/|--volume\s+/[^:]*:/|--device\s+/dev/(mem|kmem))"), 1, 0) as host_mount_flag
| host_mount_flag + privileged_flag + persistence_flag as risk_score
| where risk_score > 0
| if (persistence_flag=1 AND privileged_flag=1, "CRITICAL: Persistent privileged container",
    if (persistence_flag=1 AND host_mount_flag=1, "CRITICAL: Persistent container with host filesystem mount",
    if (privileged_flag=1 AND host_mount_flag=1, "HIGH: Privileged container with root filesystem access",
    if (persistence_flag=1, "MEDIUM: Container persistence via restart=always",
    if (privileged_flag=1, "HIGH: Container privilege escalation via capability flags",
    if (host_mount_flag=1, "HIGH: Host root filesystem bind mount",
    "MEDIUM: Suspicious container configuration")))))) as attack_pattern
| fields _messagetime, _sourceHost, _sourceCategory, container_runtime, run_args, persistence_flag, privileged_flag, host_mount_flag, risk_score, attack_pattern
| sort by _messagetime desc

// Append container exec interactive shell detection
| append [
(_sourceCategory=*linux* OR _sourceCategory=*audit* OR _sourceCategory=*syslog*)
| where _raw matches /(?i)(docker|podman|nerdctl)\s+exec/
| where _raw matches /(?i)(\/(bin\/bash|bin\/sh|bin\/zsh)|(\s-i\s)|(sh\s-c))/
| parse regex "(?P<container_runtime>docker|podman|nerdctl)" nodrop
| 0 as persistence_flag | 0 as privileged_flag | 0 as host_mount_flag | 1 as risk_score
| "MEDIUM: Interactive shell exec into running container" as attack_pattern
| fields _messagetime, _sourceHost, _sourceCategory, container_runtime, persistence_flag, privileged_flag, host_mount_flag, risk_score, attack_pattern
]
high severity high confidence

Detects T1543.005 container service persistence and privilege escalation via Sumo Logic CSE. Identifies docker/podman/nerdctl run commands with --restart=always persistence flags, --privileged/--pid=host/--net=host/--cap-add capability escalation, and host root filesystem bind mounts. Calculates risk score from flag combinations and classifies attack patterns from MEDIUM to CRITICAL.

Data Sources

Linux syslog via Sumo Logic Installed CollectorLinux Auditd via Sumo LogicContainer host OS logs

Required Tables

_sourceCategory=*linux*_sourceCategory=*audit*_sourceCategory=*syslog*

False Positives & Tuning

  • Docker-in-Docker CI/CD pipelines on dedicated build servers using --privileged mode (Jenkins agents, GitLab shared runners, GitHub Actions self-hosted runners)
  • Security and monitoring tools such as Falco, Sysdig, or Datadog Agent that mount host /proc or /sys via volume mounts for system introspection
  • Container backup and disaster recovery tools that bind-mount host directories for snapshot purposes during scheduled maintenance windows
Download portable Sigma rule (.yml)

Other platforms for T1543.005


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Docker Container Persistence via restart=always

    Expected signal: Linux auditd EXECVE: type=EXECVE with a0=docker, a1=run, a2=-d, a3=--restart=always, a4=--name, a5=df00tech-persist-test. MDE DeviceProcessEvents: FileName=docker, ProcessCommandLine contains 'run' and '--restart=always'. Expected PersistenceFlag=true, PrivilegedFlag=false, HostMountFlag=false, RiskScore=1.

  2. Test 2Privileged Container Execution with Host PID Namespace

    Expected signal: Linux auditd EXECVE: type=EXECVE with args containing 'docker', 'run', '--privileged', '--pid=host'. MDE DeviceProcessEvents: ProcessCommandLine contains '--privileged' and '--pid=host'. PrivilegedFlag=true, RiskScore=1.

  3. Test 3Container with Host Root Filesystem Bind Mount

    Expected signal: Linux auditd EXECVE: args containing 'docker', 'run', '-v', '/:/host-root:ro'. MDE DeviceProcessEvents: ProcessCommandLine contains '-v /:/host-root'. HostMountFlag triggers on '-v /:/'. RiskScore=1.

  4. Test 4Combined Persistent Privileged Container (Critical Combination)

    Expected signal: Linux auditd EXECVE: args contain 'docker', 'run', '-d', '--restart=always', '--privileged', '--name', 'df00tech-critical-test'. MDE DeviceProcessEvents: ProcessCommandLine contains '--restart=always' and '--privileged'. PersistenceFlag=true, PrivilegedFlag=true, RiskScore=2.

  5. Test 5Kubernetes DaemonSet Creation for Cluster-Wide Persistence

    Expected signal: Kubernetes API server audit log: verb=create, objectRef.resource=daemonsets, objectRef.namespace=default, objectRef.name=df00tech-persist-daemonset, responseStatus.code=201. AzureDiagnostics Category=kube-audit or AKSAuditAdmin table: DaemonSet creation event with requesting user and full object spec.

Unlock Pro Content

Get the full detection package for T1543.005 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections