AWS CloudTrail Logging Modification for Defense Evasion
Attackers modify AWS CloudTrail logging configurations to evade detection by disabling or altering logging, hindering security visibility and potentially allowing further malicious activities to go unnoticed.
Attackers may attempt to modify or disable AWS CloudTrail logging to evade detection and hide their malicious activities within an AWS environment. This technique involves altering CloudTrail configurations, such as stopping log collection, modifying log storage locations, or changing the log file validation settings. The detection focuses on identifying unauthorized or suspicious modifications to CloudTrail settings, specifically UpdateTrail events, initiated from outside the AWS console. This activity is critical because CloudTrail provides essential logs for monitoring and auditing AWS account activities, and any tampering can significantly impair security monitoring and incident response capabilities. The scope of this evasion can span across an entire AWS account or specific regions, depending on the permissions and access of the attacker.
Attack Chain
- The attacker gains initial access to the AWS environment, possibly through compromised credentials or exploiting a vulnerable service.
- The attacker enumerates existing CloudTrail trails to identify the targets for modification using AWS CLI or API calls.
- The attacker invokes the
UpdateTrailAPI call to modify the CloudTrail configuration. - The
UpdateTrailrequest specifies changes to the trail, such as disabling logging by settingIsLoggingtofalse. - The attacker may also modify the S3 bucket associated with the trail to redirect logs to a different location they control.
- The attacker validates that the changes to the CloudTrail configuration have been successfully applied.
- With logging disabled or altered, the attacker proceeds with their objectives, knowing their actions are less likely to be logged and detected.
- The final objective may include data exfiltration, deployment of malicious resources, or further lateral movement within the AWS environment.
Impact
Successful modification of CloudTrail settings results in a significant loss of visibility into activities within the AWS environment. This can allow attackers to operate undetected, potentially leading to data breaches, unauthorized resource access, or deployment of persistent malware. The impact extends to hindering incident response efforts, as critical log data required for investigation is either unavailable or tampered with. Depending on the scope of the compromise, this could affect entire business units or critical infrastructure managed within the AWS account.
Recommendation
- Deploy the Sigma rule
Detect AWS CloudTrail UpdateTrail Outside Consoleto identify attempts to modify CloudTrail settings from unauthorized sources (logsource:aws:cloudtrail, eventName:UpdateTrail). - Monitor
UpdateTrailevents in CloudTrail logs (data_source:AWS CloudTrail UpdateTrail) and investigate any modifications performed by users or roles that are not explicitly authorized to manage CloudTrail configurations. - Enable multi-factor authentication (MFA) for all IAM users and roles with permissions to modify CloudTrail configurations to prevent unauthorized access (reference: https://attack.mitre.org/techniques/T1562/008/).
- Implement strong IAM policies that restrict the ability to modify or delete CloudTrail trails to a limited set of highly privileged accounts (logsource:
aws:cloudtrail).
Detection coverage 2
Detect AWS CloudTrail UpdateTrail Outside Console
highDetects UpdateTrail events in AWS CloudTrail logs where the user agent is not the AWS console, indicating potential defense evasion.
Detect AWS CloudTrail Trail Stopped
mediumDetects CloudTrail events where a trail is stopped, which could indicate an attempt to evade logging.
Detection queries are available on the platform. Get full rules →