AWS Builder Center
AWS CloudTrail Logs to Microsoft Sentinel via SQS

AWS CloudTrail Logs to Microsoft Sentinel via SQS

This guide explains how to ingest AWS CloudTrail logs into Microsoft Sentinel using Amazon S3 and Amazon SQS.

Overview
This guide explains how to ingest AWS CloudTrail logs into Microsoft Sentinel using Amazon S3 and Amazon SQS.
The architecture is:
AWS CloudTrail → Amazon S3 → S3 Event Notification → Amazon SQS → Microsoft Sentinel → Log Analytics
Microsoft Sentinel uses the SQS messages to identify new objects in S3 and then retrieves the corresponding log files from the bucket.

Architecture

AWS Account
│
▼
AWS CloudTrail
│
│ CloudTrail JSON/GZIP logs
▼
Amazon S3 Bucket
│
│ Object notification
▼
Amazon SQS Queue
│
│ S3 object path
▼
Microsoft Sentinel AWS S3 Connector
│
▼
Log Analytics Workspace
│
▼
AWSCloudTrail Table
│
▼
KQL → Detection → Analytics Rules → Incidents


1. Enable AWS CloudTrail

Create or use an existing CloudTrail trail and configure it to record the required management and/or data events.
Configure CloudTrail to deliver its logs to an S3 bucket.
CloudTrail stores its logs in compressed  .json.gz  files inside S3.
Example path:
s3://my-cloudtrail-bucket/AWSLogs/<ACCOUNT-ID>/CloudTrail/<REGION>/...


2. Create the S3 Bucket

Create an S3 bucket dedicated to your security logs.
Example:
sentinel-cloudtrail-logs

Make sure CloudTrail has permission to write logs to this bucket.
Avoid mixing different log types in the same S3 path when configuring the Sentinel connector. Microsoft recommends dedicated paths and SQS queues for different log types.

3. Create the SQS Queue

Create an SQS queue that will receive notifications about new objects arriving in S3.
Example:
sentinel-cloudtrail-queue

The queue does not contain the complete CloudTrail log. Its purpose is to provide notification information about the new S3 object.
A notification can contain information such as:
{
"s3Bucket": "sentinel-cloudtrail-logs",
"s3ObjectKey": [
"AWSLogs/123456789012/CloudTrail/us-east-1/..."
]
}

AWS documents this S3-object notification flow for CloudTrail/SNS/SQS integrations.

4. Connect S3 Notifications to SQS

Configure the S3 bucket to send object-created notifications to the SQS queue.
The flow becomes:
CloudTrail
↓
S3 Object Created
↓
S3 Notification
↓
SQS Message

When Sentinel reads the SQS message, it can determine which S3 object contains the new log and retrieve that object.

5. Configure AWS IAM

Create an IAM role that Microsoft Sentinel can assume.
The role needs permissions required to:
  • Read the CloudTrail objects from S3
  • List/access the required S3 bucket
  • Receive and process messages from SQS
  • Delete/process SQS messages as required by the connector
Microsoft Sentinel's current AWS S3 connector uses Microsoft Entra ID OIDC authentication to assume an AWS IAM role rather than requiring long-lived AWS access keys.

6. Configure Microsoft Sentinel

In Azure:
Microsoft Sentinel → Data connectors → Amazon Web Services S3
If the connector is not available, install the Amazon Web Services solution from Content Hub.
Configure the connection with:
IAM Role ARN
+
SQS Queue URL
+
Destination Data Type

For CloudTrail, select:
AWS CloudTrail

The connector then uses the SQS queue to discover new S3 objects and retrieves the logs from S3.

7. Verify Ingestion

After generating AWS activity, allow time for CloudTrail to write the event to S3 and for the Sentinel connector to process it.
In Microsoft Sentinel, query:
AWSCloudTrail
| sort by TimeGenerated desc

For example, search for IAM activity:
AWSCloudTrail
| where EventName contains "User"
| project TimeGenerated, EventName, UserIdentityUserName, SourceIpAddress, AWSRegion
| sort by TimeGenerated desc

You can investigate events such as:
CreateUser
DeleteUser
CreateAccessKey
DeleteAccessKey
AttachUserPolicy
DetachUserPolicy
ConsoleLogin
AssumeRole


8. Troubleshooting

If Sentinel shows no data, troubleshoot from left to right:
CloudTrail
↓
Is the trail logging?
↓
S3
↓
Is the CloudTrail file present?
↓
S3 Notification
↓
Did an S3 notification get generated?
↓
SQS
↓
Are messages arriving?
↓
IAM Role
↓
Can Sentinel access S3 and SQS?
↓
Sentinel Connector
↓
AWSCloudTrail table


Check CloudTrail

Verify that the trail is enabled and generating events.

Check S3

Look for  .json.gz  CloudTrail files in the expected prefix.

Check SQS

If CloudTrail logs exist in S3 but SQS has no messages, investigate the S3 notification configuration.

Check IAM

Verify that the Sentinel-assumed role has the required S3/SQS permissions and that its trust relationship is correctly configured.

Check Sentinel

Confirm the Amazon Web Services S3 connector is connected and that the correct IAM Role ARN and SQS URL were configured. Microsoft also recommends checking connector health and SQS status when troubleshooting.

Common Mistake

One of the most important troubleshooting points is:
SQS is not the log-storage location.
S3 stores the actual CloudTrail files.
SQS provides the notification/message that tells Sentinel where the new S3 object is located.
Therefore:
S3 = Log Storage
SQS = Notification Queue
Sentinel = Log Collector/Processor
Log Analytics = Search & Detection Storage


Final Architecture

AWS
┌───────────────────────────┐
│ CloudTrail │
│ Management/Data Events │
└─────────────┬─────────────┘
│
▼
┌───────────────────────────┐
│ S3 │
│ CloudTrail JSON/GZIP │
└─────────────┬─────────────┘
│
Object notification
│
▼
┌───────────────────────────┐
│ SQS │
│ S3 Object Notifications │
└─────────────┬─────────────┘
│
▼
┌───────────────────────────┐
│ Microsoft Sentinel │
│ AWS S3 Connector │
└─────────────┬─────────────┘
│
▼
┌───────────────────────────┐
│ Log Analytics │
│ AWSCloudTrail │
└─────────────┬─────────────┘
│
▼
KQL / Analytics
│
▼
SOC Detection
│
▼
Incident Response

This architecture provides a reliable way to bring AWS security telemetry into Microsoft Sentinel for centralized SOC monitoring, threat hunting, detection engineering, and incident response. Microsoft currently supports AWS CloudTrail, VPC Flow Logs, GuardDuty, and CloudWatch through its AWS S3 connector.

Useful official references

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article