Intelligence on ECS Attacks, Tactics, Techniques & Procedures

Tales from the cloud trenches: Amazon ECS is the new EC2 for crypto mining

Where intelligence lacks, you can infer the types of attacks and behaviour you’ll observe in this service based on the nature of the GuardDuty findings for ECS:

GuardDuty Runtime Monitoring finding types - Amazon GuardDuty

Prerequisites

image.png

Key Concepts

Launch Types - How they affect your response

Launch types define how you host and manage your containers in AWS ECS. The two most common options are:

EC2 launch type vs Fargate

EC2 launch type vs Fargate

image.png

EC2 Launch Type vs Fargate

Aspect EC2-Backed ECS Fargate-Backed ECS
Storage Full access to EBS volumes for forensic imaging, timeline reconstruction, and artifact extraction. No direct access to underlying storage. Ephemeral and abstracted.
Memory Possible via Volatility or similar tools if EC2 instance is paused or imaged. Not feasible—memory is abstracted and inaccessible.
Network Can deploy packet capture tools (e.g., tcpdump) or mirror traffic via VPC features. Limited—no access to underlying network stack (typically the ENI), therefore VPC traffic mirroring isn’t typically possible$^1$. Must rely on VPC Flow Logs or CloudTrail.
Host Logs Can access , ECS agent logs, and Docker runtime metadata. Must rely on CloudWatch or FireLens—no host-level logs.
Containment Can freeze EC2 instance, snapshot EBS, enable termination protection. No pause/freeze capability. Must act fast to redirect traffic or isolate via task-level controls.
Runtime Introspection Can SSH into the EC2. Can’t SSH, you can use ESC exec commands via SSM, though further design considerations must be made well in advance.

Ref. 1 - VPC Traffic Mirroring relies on a discrete Elastic Network Interface (ENI), your ECS must be running in ‘awsvpc’ mode to take advantage of this. If you’re running in ‘awsvpc’ mode, each task that runs on the instance receives its own ENI attached to the trunk ENI, with a primary private IP address. The awsvpc network mode also allows you to leverage Amazon VPC Traffic Mirroring for security and monitoring of network traffic when using instance types that don't have trunk ENIs attached. Note only certain instances are supported.