AWS CloudTrail Log Deletion for Defense Evasion
An adversary deletes AWS CloudTrail logs to evade detection and operate stealthily within a compromised AWS environment, removing audit trails of their malicious activity.
This threat brief focuses on the detection of malicious actors deleting AWS CloudTrail logs within a compromised AWS environment. AWS CloudTrail is a service that enables governance, compliance, operational auditing, and risk auditing of an AWS account. Attackers may attempt to delete these logs to remove evidence of their activities, making it more difficult for defenders to investigate and respond to security incidents. This is a defense evasion technique that can significantly hinder incident response efforts. The deletion is detected by monitoring DeleteTrail events within CloudTrail logs, excluding those originating from the AWS console. Successful deletion of CloudTrail logs allows attackers to cover their tracks, potentially leading to prolonged unauthorized access and further exploitation.
Attack Chain
- The attacker gains initial access to an AWS account through compromised credentials or by exploiting a vulnerability in an AWS service.
- The attacker enumerates existing CloudTrail trails to identify the target log storage.
- The attacker escalates privileges within the AWS environment to gain sufficient permissions to delete CloudTrail trails. This may involve exploiting IAM misconfigurations or vulnerabilities.
- The attacker uses the AWS CLI or API to execute the
DeleteTrailcommand, specifying the name of the CloudTrail trail to be deleted. - CloudTrail logs the
DeleteTrailevent, including the user identity, source IP address, and timestamp of the deletion attempt. - If the deletion is successful, the targeted CloudTrail log is permanently removed, eliminating valuable audit data.
- The attacker continues with their malicious activities, now with reduced risk of detection due to the absence of CloudTrail logs.
Impact
The successful deletion of CloudTrail logs can have severe consequences. It can hinder incident response efforts, making it difficult to identify the scope and nature of a security breach. The number of affected organizations depends on the scope of the initial compromise. The sectors most at risk are those that rely heavily on AWS for their infrastructure, including e-commerce, finance, and healthcare. Successful deletion allows attackers to operate undetected, potentially leading to data theft, system compromise, and financial loss.
Recommendation
- Deploy the Sigma rule
AWS CloudTrail Trail Deletionto detectDeleteTrailevents and alert on suspicious activity (rule provided below). - Enable and monitor AWS CloudTrail logs for
DeleteTrailevents and ensure proper log retention policies are in place (data_source:AWS CloudTrail DeleteTrail). - Investigate any
DeleteTrailevents that do not originate from authorized administrative accounts or processes (eventName = DeleteTrail,userAgent !=console.amazonaws.com). - Review and enforce strict IAM policies to restrict the ability to delete CloudTrail trails to a limited number of highly privileged accounts.
- Implement multi-factor authentication (MFA) for all AWS accounts, especially those with permissions to modify or delete CloudTrail configurations.
Detection coverage 2
AWS CloudTrail Trail Deletion
highDetects deletion of AWS CloudTrail trails by non-console users, which can indicate defense evasion.
AWS CloudTrail Trail Deletion - API
mediumDetects deletion of AWS CloudTrail trails via direct API calls, potentially indicating programmatic defense evasion.
Detection queries are available on the platform. Get full rules →