Resource Hijacking: Compute Hijacking - ECS


AWS Specific Sub-Technique


AWS Specific Content

A prerequisite for this technique is that a threat actor has already gained control of an AWS identity with the permissions to access or create Amazon ECS resources.

Using this technique, a threat actor can use Amazon ECS resources for their computation requirements with the cost of the resources being attributed to the compromised account. Threat actors can either hijack an existing ECS container or create ECS containers or clusters for this purpose.

This technique is related to the Modify Cloud Compute Infrastructure > Create Cloud Instance technique and is used to additionally identify what type of cloud instance was created.

Detection

AWS Specific Content


Configure, review, and monitor VPC Flow logs traffic egress from the ECS container to capture records of unauthorized all traffic originating or transiting through the ECS container.

Amazon GuardDuty has detections and finding types for when potential threats based on operating system-level behavior on ECS workloads is found.

When this technique is used by the threat actor, actions taken by the threat actor using the credentials obtained will be logged in CloudTrail. You can use the Event History page in the AWS CloudTrail console to view the last 90 days of management events in an AWS Region for the events listed in the AWS CloudTrail Event Name(s) section, such as ecs:CreateCluster.

A separate CloudTrail trail will give you an ongoing record of events in your AWS account past 90 days and can be configured to log events in multiple regions. You can also review events using the console as well as the AWS CLI.

It is also possible to create a CloudWatch metric filter to watch for when specific AWS API calls are used and perform notification actions if logged, and additionally configure CloudWatch to automatically perform an action in response to an alarm.


Mitigation

AWS Specific Content


You can make sure that principals are scoped with the least-privileged permissions necessary to perform duties, limiting the ability to perform unauthorized actions in an AWS account when not required. One possible method of applying the principle of least-privileged permissions is to use Service Control Policies to restrict the maximum available permissions for the IAM users and IAM roles within your AWS Organizations accounts (note - you should test SCPs in a development environment before deploying them in production).

You can also use IAM Access Analyzer to regularly review and verify access and manage permissions across your AWS environment, which will highlight AWS identities with excessive permissions and the actions performed by those identities.

It is also possible to block the use of IAM user and IAM role credentials outside of trusted IP networks using Service Control Policies. Examples of these policies are available in the aws-samples repository for data perimeters, and include a sample policy for IAM users and a sample policy for IAM roles.


AWS Specific Information


AWS Services:
  • Amazon Elastic Container Service (ECS)
AWS CloudTrail Event Names:
  • ecs:CreateCluster
  • ecs:CreateService
  • ecs:RegisterTaskDefinition
  • ecs:UpdateService

Technique Information

ID: T1496.A006
Aliases: T1496.A006, T1496.001.A006
Sub-technique of: T1496
Tactics:
  • Impact
Platforms:
  • Amazon Web Services (AWS)
Created: 13 Sep 2024
Last Modified: 30 May 2025