Data Destruction: S3 Object and Bucket Deletion
AWS Specific Sub-Technique
Other sub-techniques of Data Destruction (4)
ID | Name |
---|---|
T1485.001 | Lifecycle-Triggered Deletion |
T1485.A001 | RDS Instances and Backups |
T1485.A003 | S3 Object and Bucket Deletion |
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 use the
s3:DeleteBucket
, s3:DeleteObject
, or s3:DeleteObjects
APIs to delete objects and buckets within an AWS account.Using this technique, a threat actor can delete objects and buckets within an AWS account, which is typically used as part of a ransomware campaign. This technique is related to Cloud Storage Discovery > S3 Objects and Buckets, as a threat actor will view information about Amazon S3 buckets in the AWS account (
s3:ListBuckets
) and view objects in the buckets (s3:ListObjects
) prior to deleting the objects. Note that it is also possible to use the s3:PutBucketLifecycleConfiguration
API to delete objects within an AWS account - the use of that API is described in the Data Destruction > Lifecycle-Triggered Deletion technique.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
s3:DeleteBucket
.To view object-level API activity such as
s3:DeleteObjects
, you will need to log data events with a separate CloudTrail trail as object-level API activity will not show up in CloudTrail Event history.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 objects and buckets in your environment are deleted in an anomalous way, Amazon GuardDuty S3 Protection is configured within the AWS account, a GuardDuty finding may be created when this occurs. For example, the Impact:S3/AnomalousBehavior.Delete finding is used to identify when an S3 API commonly used to delete data from an AWS environment was invoked in an anomalous way. To view additional information on the GuardDuty S3 Protection finding types, click here.
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.
This technique is typically used by threat actors as part of a ransomware campaign. AWS has published several resources on how to protect against ransomware and mitigate some of the actions described by this technique. However, an effective mitigation against data destruction is through the implementation and testing of robust backup processes.