Unusual Process Resolving AWS ECS Agent Communication Service Endpoint

Identifies a process other than the Amazon ECS agent performing a DNS lookup for an ECS Agent Communication Service (ACS) or Telemetry Service (TACS) hostname on a Linux host. The ECScape technique abuses the undocumented ACS protocol: a compromised container that can reach the instance metadata service steals the EC2 instance role credentials, then impersonates the ECS agent over ACS to receive the task role credentials of every other task scheduled on the same host. No container escape is required, and the credential theft crosses task boundaries that operators assume are isolated. Only the ECS agent should be speaking this protocol.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/09/14"
  3integration = ["endpoint"]
  4maturity = "production"
  5min_stack_version = "9.3.0"
  6min_stack_comments = "DNS for Linux support was introduced in 9.3.0"
  7updated_date = "2026/09/14"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies a process other than the Amazon ECS agent performing a DNS lookup for an ECS Agent Communication Service
 13(ACS) or Telemetry Service (TACS) hostname on a Linux host. The ECScape technique abuses the undocumented ACS
 14protocol: a compromised container that can reach the instance metadata service steals the EC2 instance role credentials, 
 15then impersonates the ECS agent over ACS to receive the task role credentials of every other task scheduled on the same
 16host. No container escape is required, and the credential theft crosses task boundaries that operators assume are isolated. 
 17Only the ECS agent should be speaking this protocol.
 18"""
 19false_positives = [
 20    """
 21    Custom ECS agent implementations or ECS-agent-compatible schedulers may legitimately contact ACS. Add their executable paths 
 22    to the exclusion list. Allowlist known sidecar executable paths if alert volume from those containers is high.
 23    """,
 24]
 25from = "now-9m"
 26language = "esql"
 27license = "Elastic License v2"
 28name = "Unusual Process Resolving AWS ECS Agent Communication Service Endpoint"
 29references = [
 30    "https://www.sweet.security/blog/ecscape-understanding-iam-privilege-boundaries-in-amazon-ecs",
 31    "https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html",
 32]
 33note = """## Triage and analysis
 34
 35### Investigating Unusual Process Resolving AWS ECS Agent Communication Service Endpoint
 36
 37ACS (`ecs-a-*.<region>.amazonaws.com`) and TACS (`ecs-t-*.<region>.amazonaws.com`) are the private control and telemetry channels between the ECS agent and the ECS service. No workload process has a legitimate reason to resolve them. A non-agent process doing so is consistent with ECScape, where a compromised task uses stolen instance-role credentials to impersonate the agent over ACS and receive the task role credentials of every other task on the host.
 38
 39### Possible investigation steps
 40
 41- Pivot on `process.entity_id` to the process start event for `process.command_line`, `process.parent.name`, and `process.parent.executable`; network events only carry `process.parent.entity_id`.
 42- Confirm the process is not the ECS agent itself. On ECS-optimized AMIs the agent runs as the `ecs-agent` container with executable `/agent`; on Bottlerocket and package installs it is `/usr/bin/amazon-ecs-agent`.
 43- Look for a preceding connection from the same host to `169.254.169.254` or `169.254.170.2` by a non-agent process, which would be the credential theft step.
 44- Review CloudTrail for `DiscoverPollEndpoint` calls made with the instance role from an unexpected source, and for API calls made with other tasks' role credentials shortly after.
 45- Check whether the process subsequently spawned children or wrote AWS credentials files.
 46- Look for lateral movement indicators: unusual parent processes, shell scripts, or memory-resident execution that would explain why an unexpected binary is contacting the ECS control plane (ACS/TACS).
 47
 48### False positive analysis
 49
 50- Custom ECS-compatible agents, schedulers, or health checks that speak to ACS/TACS directly may trigger this rule.
 51- If the alert fires on a known tool, add its executable path or process name to the rule's exclusion list.
 52
 53### Response and remediation
 54
 55- Isolate the host if credential theft is suspected and rotate any AWS credentials that may have been exposed.
 56- Review CloudTrail for API calls made with the task's IAM role shortly after the event timestamp.
 57- Investigate how the suspicious process was introduced and remediate the root cause (e.g., compromised container image, code execution vulnerability).
 58"""
 59risk_score = 47
 60rule_id = "eec07086-37c7-4285-bfa2-a4ce03c7648c"
 61setup = """## Setup
 62
 63This rule requires data coming in from Elastic Defend.
 64
 65### Elastic Defend Integration Setup
 66Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the
 67Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 68
 69#### Prerequisite Requirements:
 70- Fleet is required for Elastic Defend.
 71- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 72
 73#### The following steps should be executed in order to add the Elastic Defend integration:
 74- Go to the Kibana home page and click "Add integrations".
 75- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 76- Click "Add Elastic Defend".
 77- Configure the integration name and optionally add a description.
 78- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 79- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can
 80  click the "Existing hosts" tab and select an existing policy instead.
 81- Click "Save and Continue".
 82- To complete the integration, select "Add Elastic Agent to your hosts" and install Elastic Agent on your hosts.
 83For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 84"""
 85severity = "medium"
 86tags = [
 87    "Domain: Endpoint",
 88    "Domain: Cloud",
 89    "Platform: AWS",
 90    "Platform: Linux",
 91    "OS: Linux",
 92    "Tactic: Discovery",
 93    "Data Source: Elastic Defend",
 94    "Rule Type: ES|QL",
 95    "Resources: Investigation Guide",
 96]
 97timestamp_override = "event.ingested"
 98type = "esql"
 99
100query = '''
101FROM logs-endpoint.events.network-* METADATA _id, _index, _version
102| WHERE host.os.type == "linux"
103    AND event.action IN ("lookup_requested", "lookup_result")
104    AND process.executable IS NOT NULL
105    AND (
106      TO_LOWER(dns.question.name) LIKE "ecs-a-*.amazonaws.com*" OR
107      TO_LOWER(dns.question.name) LIKE "ecs-t-*.amazonaws.com*"
108    )
109    AND NOT process.name IN ("amazon-ecs-agent", "ecs-agent", "amazon-ssm-agent", "aws-vpc-cni")
110    AND NOT (
111      process.executable == "/agent" OR
112      process.executable == "/usr/bin/amazon-ecs-agent" OR
113      process.executable LIKE "/managed-agents/*" OR
114      process.executable LIKE "/usr/libexec/amazon-ecs-*" OR
115      process.executable LIKE "/var/lib/ecs/*" OR
116      process.executable LIKE "/opt/Elastic/Agent/*"
117    )
118| KEEP _id, _index, _version, @timestamp, data_stream.namespace, host.id, host.name, user.id, user.name,
119    process.entity_id, process.parent.entity_id, process.pid, process.name, process.executable, dns.question.name
120'''
121
122[[rule.threat]]
123framework = "MITRE ATT&CK"
124[[rule.threat.technique]]
125id = "T1526"
126name = "Cloud Service Discovery"
127reference = "https://attack.mitre.org/techniques/T1526/"
128
129[[rule.threat.technique]]
130id = "T1580"
131name = "Cloud Infrastructure Discovery"
132reference = "https://attack.mitre.org/techniques/T1580/"
133
134
135[rule.threat.tactic]
136id = "TA0007"
137name = "Discovery"
138reference = "https://attack.mitre.org/tactics/TA0007/"
139
140[rule.alert_suppression]
141group_by = ["host.id", "process.executable"]
142missing_fields_strategy = "suppress"
143
144[rule.alert_suppression.duration]
145unit = "h"
146value = 1

Triage and analysis

Investigating Unusual Process Resolving AWS ECS Agent Communication Service Endpoint

ACS (ecs-a-*.<region>.amazonaws.com) and TACS (ecs-t-*.<region>.amazonaws.com) are the private control and telemetry channels between the ECS agent and the ECS service. No workload process has a legitimate reason to resolve them. A non-agent process doing so is consistent with ECScape, where a compromised task uses stolen instance-role credentials to impersonate the agent over ACS and receive the task role credentials of every other task on the host.

Possible investigation steps

  • Pivot on process.entity_id to the process start event for process.command_line, process.parent.name, and process.parent.executable; network events only carry process.parent.entity_id.
  • Confirm the process is not the ECS agent itself. On ECS-optimized AMIs the agent runs as the ecs-agent container with executable /agent; on Bottlerocket and package installs it is /usr/bin/amazon-ecs-agent.
  • Look for a preceding connection from the same host to 169.254.169.254 or 169.254.170.2 by a non-agent process, which would be the credential theft step.
  • Review CloudTrail for DiscoverPollEndpoint calls made with the instance role from an unexpected source, and for API calls made with other tasks' role credentials shortly after.
  • Check whether the process subsequently spawned children or wrote AWS credentials files.
  • Look for lateral movement indicators: unusual parent processes, shell scripts, or memory-resident execution that would explain why an unexpected binary is contacting the ECS control plane (ACS/TACS).

False positive analysis

  • Custom ECS-compatible agents, schedulers, or health checks that speak to ACS/TACS directly may trigger this rule.
  • If the alert fires on a known tool, add its executable path or process name to the rule's exclusion list.

Response and remediation

  • Isolate the host if credential theft is suspected and rotate any AWS credentials that may have been exposed.
  • Review CloudTrail for API calls made with the task's IAM role shortly after the event timestamp.
  • Investigate how the suspicious process was introduced and remediate the root cause (e.g., compromised container image, code execution vulnerability).

References

Related rules

to-top