Modify Cloud Compute Infrastructure: Create Cloud Instance

Other sub-techniques of Modify Cloud Compute Infrastructure (5)

An adversary may create a new instance or virtual machine (VM) within the compute service of a cloud account to evade defenses. Creating a new instance may allow an adversary to bypass firewall rules and permissions that exist on instances currently residing within an account. An adversary may Create Snapshot [MITRE] of one or more volumes in an account, create a new instance, mount the snapshots, and then apply a less restrictive security policy to collect Data from Local System [MITRE] or for Remote Data Staging [MITRE] .

Creating a new instance may also allow an adversary to carry out malicious activity within an environment without affecting the execution of current running instances.

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 perform the actions in the AWS CloudTrail Event Name(s) section.

With access to an AWS identity that has the appropriate permissions, threat actors can create a new computing instance to hijack resources or evade defenses. Creating a new instance may also allow a threat actor to carry out unauthorized activity within an environment without affecting the execution of current running instances.

Detection

The creation of a new instance or VM is a common part of operations within many cloud environments. Events should then not be viewed in isolation, but as part of a chain of behavior that could lead to other activities. For example, the creation of an instance by a new user account or the unexpected creation of one or more snapshots followed by the creation of an instance may indicate suspicious activity. In AWS, CloudTrail logs capture the creation of an instance in the RunInstances event, and in Azure the creation of a VM may be captured in Azure activity logs.(Citation: AWS CloudTrail Search)(Citation: Azure Activity Logs) Google's Admin Activity audit logs within their Cloud Audit logs can be used to detect the usage of gcloud compute instances create to create a VM.(Citation: Cloud Audit Logs)

AWS Specific Content


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 ec2:RunInstances or 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.

If an EC2 is created for the purposes of resource hijacking and Amazon GuardDuty is configured within the AWS account, a GuardDuty finding may be created when the instance is used. For example, the CryptoCurrency:EC2/BitcoinTool.B finding is used to identify when an EC2 instance in the environment is querying an IP address associated with Bitcoin or other cryptocurrency-related activity.


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.


References

AWS Specific Information


AWS Services:
  • Amazon Elastic Compute Cloud (EC2)
  • Amazon Elastic Container Service (ECS)
  • Amazon Elastic Kubernetes Service (EKS)
AWS CloudTrail Event Names:
  • eks:CreateCluster
  • eks:UpdateClusterConfig
  • ecs:CreateCluster
  • ecs:CreateService
  • ecs:UpdateService
  • ec2:RunInstances
  • ec2:RequestSpotFleet

Technique Information

ID: T1578.002
Aliases: T1578.002, AT1030
Sub-technique of: T1578
Tactics:
  • Defense Evasion
  • Impact
Platforms:
  • IaaS
  • Amazon Web Services (AWS)
Created: 12 Sep 2024
Last Modified: 30 May 2025