AWS CloudTrail Logging Evasion via UpdateTrail
Attackers modify AWS CloudTrail settings using UpdateTrail events to evade detection by disabling or limiting logging, as indicated by non-console user agents.
The threat involves adversaries attempting to evade detection within AWS environments by modifying CloudTrail settings. This is achieved through the use of UpdateTrail events, specifically targeting configurations that can limit or disable logging capabilities. The activity is identified by analyzing CloudTrail logs for UpdateTrail events where the user agent is not the AWS console and the operation is successful. This behavior, if malicious, allows attackers to operate undetected within the compromised AWS account, leading to further compromise and data exfiltration. This attack is significant because CloudTrail provides critical visibility into AWS account activity, and disabling or modifying it can severely hamper incident response and forensic investigations.
Attack Chain
- An attacker gains initial access to an AWS account, potentially through compromised credentials or exploiting a vulnerability in a web application.
- The attacker authenticates to the AWS environment using the compromised credentials.
- The attacker executes an
UpdateTrailAPI call to modify the CloudTrail configuration. - The
UpdateTrailcall is made with a user agent different from the AWS console to avoid detection based on typical administrative behavior. - The attacker modifies the trail settings, such as disabling logging, changing the destination bucket, or altering the included event types.
- The successful
UpdateTrailevent is logged in CloudTrail, but the attacker’s subsequent actions are not logged due to the altered configuration. - The attacker performs malicious activities within the AWS environment, such as data exfiltration, resource deployment, or privilege escalation.
- The attacker attempts to remove or obfuscate remaining evidence of the
UpdateTrailmodification to further hinder detection.
Impact
Successful modification of CloudTrail settings can lead to a significant loss of visibility into AWS account activity. Attackers can operate undetected, exfiltrate sensitive data, deploy malicious resources, and escalate privileges without being logged. The number of victims is dependent on the scope of access granted to the compromised AWS account. Organizations across all sectors are potentially at risk, with the impact ranging from data breaches and financial loss to reputational damage and regulatory penalties.
Recommendation
- Deploy the Sigma rule
AWS CloudTrail UpdateTrail Event from Non-Console User Agentto detect suspicious modifications to CloudTrail settings. - Investigate any
UpdateTrailevents where the user agent is not the AWS console (as highlighted by the Sigma rule) to determine if the changes were authorized. - Monitor CloudTrail logs for any unusual activity, especially API calls from unfamiliar IP addresses (
network_connectionevents). - Implement multi-factor authentication (MFA) to protect AWS accounts from credential compromise (related to initial access stage).
- Enable and review AWS Config rules to detect and remediate non-compliant CloudTrail configurations (check for disabled logging, modified buckets, etc.).
Detection coverage 2
AWS CloudTrail UpdateTrail Event from Non-Console User Agent
highDetects UpdateTrail events in AWS CloudTrail logs where the user agent is not the AWS console, indicating potential defense evasion.
AWS CloudTrail UpdateTrail Event Success
mediumDetects successful UpdateTrail events in AWS CloudTrail logs.
Detection queries are kept inside the platform. Get full rules →