CloudTrail anomaly detection
How an AI SOC detects risky AWS activity in CloudTrail, such as access keys created outside Terraform, and investigates every alert it raises.
The short answer
CloudTrail anomaly detection watches AWS management events for actions that should be rare, such as access keys created outside infrastructure as code. Cotool ingests CloudTrail into an aws_cloudtrail table, Python detections run on it, and an agent investigates every alert they raise.[1][2]
The problem
How an AI SOC handles it
Ingest CloudTrail
CloudTrail files land in S3, S3 notifies an SQS queue dedicated to Cotool, and Cotool unwraps the
Recordsenvelope into theaws_cloudtrailtable.[1]Write the detection
From an editor connected to Cotool's MCP server, a coding agent searched 30 days of CreateAccessKey events, created a detection for keys made outside Terraform, tested it, and deployed it.[2]
Close the loop
Each verdict feeds back into the detection, so expected automation gets tuned out.[2]
Example
SELECT event_time, actor, actor_type, ip_address, account_id, region, outcome
FROM aws_cloudtrail
WHERE action = 'CreateAccessKey'
AND event_time > now() - INTERVAL 1 DAY
ORDER BY event_time DESC
LIMIT 100A Log Search query in ClickHouse SQL over Cotool's CloudTrail table. Column names follow Cotool's CloudTrail mapping; confirm them in your workspace.[1][5]
What people approve
How Cotool handles it
- Cotool's CloudTrail and GCP audit log tables share actor, action, and resource columns, so one query can follow an identity across both clouds.[1]
Integrations used
Sources
- AWS S3/SQS log ingest (Cotool docs) · accessed November 16, 2026
- Detection engineering (Cotool Detect) · accessed November 16, 2026
- Changelog (Cotool docs) · accessed November 16, 2026
- Respond to every signal (Cotool Respond) · accessed November 16, 2026
- Search logs (Cotool docs) · accessed November 16, 2026
- AI SOC (Cotool) · accessed November 16, 2026
- Alerts (Cotool docs) · accessed November 16, 2026
- Additional Cloud Credentials, T1098.001 (MITRE ATT&CK) · accessed November 16, 2026
- LookupEvents (AWS CloudTrail API Reference) · accessed November 16, 2026



