Modify Cloud Compute Infrastructure: Delete Cloud Instance
Other sub-techniques of Modify Cloud Compute Infrastructure (5)
ID | Name |
---|---|
T1578.002 | Create Cloud Instance |
T1578.001 | Create Snapshot |
T1578.003 | Delete Cloud Instance |
T1578.005 | Modify Cloud Compute Configurations |
An adversary may delete a cloud instance after they have performed malicious activities in an attempt to evade detection and remove evidence of their presence. Deleting an instance or virtual machine can remove valuable forensic artifacts and other evidence of suspicious behavior if the instance is not recoverable.
An adversary may also
Create Cloud Instance [MITRE]
and later terminate the instance after achieving their objectives.
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 delete a cloud instance after they have performed unauthorized actions on the instance in an attempt to evade detection and remove evidence of their activity. Deleting an instance can remove valuable forensic artifacts and other evidence of suspicious behavior if the instance is not recoverable. Additionally, threat actors and insider threats can delete cloud instances within an AWS account, causing destructive impact to the AWS account holder.
Detection
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:TerminateInstances
or ecs:DeleteService
.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.