Detection: CloudTrail Trail Logging Stopped
Overview
Detect when logging was stopped for an AWS CloudTrail trail. Disabling logging creates gaps in security monitoring and audit trails, increasing the risk of undetected malicious activity, such as unauthorized access or data exfiltration. Monitoring logging status ensures continuous visibility into account activity and supports incident response and compliance efforts.
References:
Usage
Run the detection in your terminal:
powerpipe detection run aws_cloudtrail_log_detections.detection.cloudtrail_trail_logging_stopped
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe detection run aws_cloudtrail_log_detections.detection.cloudtrail_trail_logging_stopped --share
SQL
This detection uses a named query:
select tp_timestamp as timestamp,string_split(event_source, '.')[1] || ':' || event_name as operation,request_parameters ->> 'name' as resource,user_identity.arn as actor,tp_source_ip as source_ip,tp_index as account_id,aws_region as region,tp_id as source_id,*
from aws_cloudtrail_logwhere event_source = 'cloudtrail.amazonaws.com' and event_name = 'StopLogging' and error_code is null
order by event_time desc;