AWS CloudTrail
Coralogix provides a predefined Lambda function to forward your CloudTrail logs straight to the Coralogix platform using our app in the Serverless Application Repository.
Requirements
-
Active trail in your AWS account enabled and sending data to your S3 bucket
-
Permissions to create Lambda functions
Setup
-
Log in to your AWS console.
-
Navigate to the Coralogix AWS Shipper application page.
-
Scroll to the bottom of the page and fill in the relevant fields.
Note! Ensure that the region in which the CloudFormation application is being run is identical to the region in which the CloudTrail S3 bucket exists.
-
Check the checkbox:
I acknowledge that this app creates custom IAM roles and resource policies. -
Click Deploy.
-
View your logs in your Coralogix dashboard.
Parameters & Details
Below is a table of references to the parameters you will see in the deployment screen.
| Parameter Name | Description |
|---|---|
| Application Name | Name of the Lambda function in your account |
| NotificationEmail | Failure notification email address Requires a working SNS with a validated domain |
| SnsKmsKeyArn | Optional KMS key ARN (not an alias) to encrypt the Lambda failure-notification SNS topic. Leave empty for no encryption. The key policy must allow sns.amazonaws.com and the Lambda execution role to use kms:Decrypt and kms:GenerateDataKey*. |
| S3BucketName | Name of the S3 bucket with CloudTrail logs to watch |
| ApplicationName | Application name as it appears in your Coralogix UI, i.e. CloudTrail |
| CoralogixRegion | Region associated with your Coralogix account domain In case that you want to use a custom domain, leave this as default and input the custom domain in the CustomDomain field. |
| CustomDomain | Coralogix custom domain Leave empty if you do not use a custom domain. |
| FunctionArchitecture | Function supports x86_64 or arm64 |
| FunctionMemorySize | Max memory for the function itself Default is 1024. |
| FunctionTimeout | Maximum time in seconds the function may be allowed to run Default is 300. |
| ApiKey | Your Coralogix Send-Your-Data API key If you have created a secret in AWS Secrets Manager, use the secret that contains your Coralogix Send-Your-Data API key. |
| Layer_ARN | If using AWS Secrets Manager, this is the ARN of the Coralogix Lambda layer. If not, leave empty. |
| CreateSecret | If you have created a secret in AWS Secrets Manager containing your Coralogix Send-Your-Data API key, set to False. |
| SubsystemName | Subsystem name as it appears in your Coralogix UI, i.e. AWS account ID |
| S3KeyPrefix | Prefix of the path within the log that allows you choose whether part or all of the bucket is shipped |
| S3KeySuffix | S3 path suffix to watch Default is .json.gz. |
Best Practices
Customers should add environment variable CORALOGIX_BUFFER_SIZE with value 268435456.
Troubleshooting
- Deployment fails with
Configuration is ambiguously defined. Amazon S3 rejects the deployment when the event notification the shipper creates overlaps with one already on the CloudTrail bucket. Two notifications overlap when their event types and their prefix or suffix overlap. Open the bucket in the Amazon S3 console, go to Properties > Event notifications, and delete the overlapping notification. Then deploy again. Alternatively, set S3KeyPrefix or S3KeySuffix so the shipper's notification no longer overlaps the existing one. - The overlapping notification is still there after I deleted its Lambda trigger. Deleting a Lambda trigger doesn't delete the matching S3 event notification. Delete the notification on the bucket as well.
- I can't remove the overlap because another service needs the existing notification. Send the bucket's events to an Amazon SNS topic or Amazon SQS queue and subscribe both the shipper and the other service to it.
For the full list of causes and fixes, see the AWS article How do I resolve the error "Configuration is ambiguously defined".
Additional Resources
| External Documentation | Serverless Application Repository |