CloudTrail
Observo natively does not support CloudTrail as a source. However, you can process CloudTrail logs through our observability pipeline by following the steps, mentioned in the document.
Purpose
The purpose of the CloudTrail integration is to enable comprehensive monitoring and analysis of AWS account activity by collecting CloudTrail logs directly from S3 buckets. This setup supports streamlined data pipelines, security monitoring, compliance auditing, and analytics, allowing organizations to enhance observability and data-driven decision-making for their AWS environments.
Prerequisites
Before configuring CloudTrail log collection for Observo AI, ensure the following requirements are met to facilitate seamless data ingestion:
AWS CloudTrail Setup:
CloudTrail must be enabled and actively logging events in your AWS account.
CloudTrail must be configured to deliver logs to an S3 bucket.
Note the S3 bucket name and prefix where CloudTrail logs are stored.
AWS S3 Bucket:
An existing S3 bucket where CloudTrail logs are delivered.
S3 bucket must be configured to send notifications for new object creation events.
Ensure appropriate bucket permissions for Observo AI to read objects.
AWS SQS Queue:
An SQS queue must be created to receive S3 bucket notifications.
The queue must be configured with appropriate permissions to receive messages from S3.
Note the SQS queue URL and ARN for Observo AI configuration.
IAM Permissions:
Observo AI requires IAM credentials or role with permissions for:
S3: GetObject, ListBucket
SQS: ReceiveMessage, DeleteMessage, GetQueueAttributes
Network and Connectivity:
Configure VPC endpoints or internet gateway as needed.
Verify firewall rules allow outbound connections to AWS services.
CloudTrail Logs
CloudTrail enabled with S3 delivery
Note S3 bucket name and prefix for CloudTrail logs
S3 Bucket
Bucket containing CloudTrail logs
Must support event notifications
SQS Queue
Queue for S3 bucket notifications
Note queue URL and ARN
IAM Permissions
S3 read and SQS permissions
Required for reading logs and processing notifications
Network Connectivity
Observo AI access to AWS services
Configure VPC endpoints or internet access
Integration
The Integration section outlines the configuration steps for CloudTrail log collection. Follow these steps to set up the integration:
Step 1: Verify CloudTrail Configuration
Go to the AWS Management Console.
Navigate to CloudTrail → Trails.
Select your CloudTrail trail and verify it is logging events.
Note the S3 bucket name where logs are delivered.
Note the S3 key prefix (if any) used for CloudTrail logs.
Step 2: Create an SQS Queue
Navigate to SQS in the AWS Management Console.
Click Create queue.
Choose Standard queue type.
Provide a unique queue name (e.g.,
observo-cloudtrail-queue).Configure queue settings
Click Create queue.
Note the Queue URL and Queue ARN for later use.
Step 3: Configure SQS Queue Policy
In the SQS queue details page, click on the Access policy tab.
Click Edit to modify the access policy.
Step 4: Configure S3 Bucket Notifications
Navigate to S3 in the AWS Management Console.
Select the S3 bucket where CloudTrail logs are stored.
Click on the Properties tab.
Scroll down to Event notifications and click Create event notification.
Configure the event notification:
Event name: Provide a descriptive name (e.g.,
cloudtrail-to-observo)Prefix: (Optional) Specify the CloudTrail prefix if logs are organized by prefix
Suffix:
.json.gz(CloudTrail logs are gzip-compressed JSON files)Event types: Select All object create events
Destination: Choose SQS queue
SQS queue: Select the queue created in Step 2
Click Save changes.
Verify the event notification is active.
Step 5: Create IAM User or Role for Observo AI
Navigate to IAM in the AWS Management Console.
Choose to create either an IAM User (with access keys) or an IAM Role (for cross-account access).
For IAM User:
Click Users → Add users.
Provide a username (e.g.,
observo-cloudtrail-reader).Select Access key - Programmatic access.
Click Next: Permissions.
For IAM Role:
Click Roles → Create role.
Select Another AWS account as the trusted entity.
Enter Observo AI's AWS account ID (obtain from Observo AI support).
Click Next: Permissions.
Click Create policy and add the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3ReadAccess",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::<CloudTrail-Bucket-Name>",
"arn:aws:s3:::<CloudTrail-Bucket-Name>/*"
]
},
{
"Sid": "SQSAccess",
"Effect": "Allow",
"Action": [
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"sqs:GetQueueAttributes"
],
"Resource": "arn:aws:sqs:<Region>:<Account-ID>:<Queue-Name>"
}
]
}Replace the placeholders with your specific values.
Name the policy (e.g.,
ObservoCloudTrailS3Access).Attach the policy to the user or role.
For IAM User: Complete the user creation and save the access key ID and secret access key.
For IAM Role: Complete the role creation and note the Role ARN.
Step 6: Configure Observo AI AWS S3 Source
Log in to the Observo AI platform.
Navigate to the Sources tab.
Click Add Source and select Create New.
Choose AWS S3 from the list of available sources.
Configure the source with the details mentioned in the AWS S3 Source .
Step 7: Verify Data Ingestion
In Observo AI, navigate to the Data or Logs section.
Filter by the source name created in Step 6.
Verify that CloudTrail events are appearing in near real-time.
Check for proper parsing and field extraction of CloudTrail JSON structure.
Monitor the SQS queue in AWS Console to ensure messages are being processed and deleted.
Error Handling
This section provides guidance on common errors and issues that may occur during CloudTrail log collection and their resolutions.
1. S3 Access Denied Errors
Cause: Observo AI IAM user or role lacks necessary permissions to read from the S3 bucket.
Resolution:
Verify the IAM policy attached to the user/role includes
s3:GetObjectands3:ListBucketpermissions.Ensure the S3 bucket ARN and bucket/* ARN are correctly specified in the policy.
Check S3 bucket policies for any explicit deny statements that might block access.
Verify the bucket name is spelled correctly and exists in the specified region.
If using server-side encryption, ensure the IAM user/role has permissions to use the KMS key.
2. SQS Access Denied
Cause: Observo AI IAM credentials lack permissions to receive or delete messages from the SQS queue.
Resolution:
Verify the IAM policy includes
sqs:ReceiveMessage,sqs:DeleteMessage, andsqs:GetQueueAttributespermissions.Ensure the SQS queue ARN in the policy matches the queue being used.
Check the SQS queue access policy allows the IAM user/role to access it.
Verify the queue URL is correct and the queue exists in the specified region.
3. No Messages in SQS Queue
Cause: S3 bucket notifications are not configured correctly or CloudTrail is not writing logs.
Resolution:
Verify CloudTrail is enabled and actively logging events.
Check S3 bucket event notification configuration is active.
Verify the event notification prefix and suffix match CloudTrail log paths (
.json.gz).Test by uploading a test file to the S3 bucket and checking if SQS receives a message.
Review CloudTrail logs in S3 to confirm new files are being created.
Check S3 bucket notification permissions in the SQS queue policy.
Troubleshooting
Troubleshooting Steps
Verify CloudTrail Logging
Navigate to CloudTrail → Trails in AWS Console.
Select your trail and verify it shows as Logging: ON.
Check the S3 bucket field to confirm logs are being delivered.
Navigate to the S3 bucket and verify recent log files exist.
Download a sample log file and verify it contains valid CloudTrail events.
Check S3 Bucket Notifications
Navigate to S3 → Buckets → [Your Bucket] → Properties.
Scroll to Event notifications section.
Verify the notification is Active and correctly configured.
Check the destination SQS queue ARN is correct.
Verify the prefix and suffix filters match CloudTrail log patterns.
Monitor SQS Queue
Navigate to SQS → Queues → [Your Queue] in AWS Console.
Click Send and receive messages to manually check for messages.
Review queue metrics.
Review Observo AI Logs
Access Observo AI platform logs.
Search for errors related to the CloudTrail S3 source.
Look for connection errors, authentication failures, or parsing errors.
Best Practices
Implement monitoring to proactively identify issues:
CloudWatch Alarms:
SQS queue depth exceeding threshold
SQS age of oldest message
S3 bucket event notifications delivery failures
Observo AI Metrics:
Monitor ingestion rate and lag
Track source errors and failures
Data Quality Checks:
Verify CloudTrail events are being parsed correctly
Monitor for missing fields or malformed data
Last updated
Was this helpful?

